dotnetcore / dotnetcore/FreeSql
json字段查询
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 910
- PR merge metrics
- No merged PRs in 30d
Description
表达式树没有对应的json字段查询
https://freesql.net/guide/expression-function.html
例如下图ExtraProperties字段为json存储,json里对应的字段为Cpu,Ram,Price三个动态字段

declare @jsontable table(userName varchar(50),ExtraProperties varchar(max))
insert into @jsontable values('name1','{"Cpu":"Intel I7","Ram":"32GB","Price":"1999"}')
insert into @jsontable values('name2','{"Cpu":"Intel I3","Ram":"16GB","Price":"1699"}')
select * from @jsontable
例如要模糊搜索内存为32的数据行对应sql句语如下
select * from @jsontable where JSON_VALUE(ExtraProperties, N'$.Ram') LIKE '%32%'

能否加入到SqlExt里面
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.