我正在使用此查詢。
在資料庫結構column_name中轉換成Json格式,如下所示:
[ { "Date": "2022-11-14T10:45:05.424+01:00", "Name": "nilesh1", "Level": "1" }, { "Date": "2022-11-14T10:54:15.776+01:00", "Name": "nilesh2", "Level": "2" } ]
我必須在 Laravel eloquent 中使用以下查詢:
select [customername] as [customerName] from [opf_details] CROSS APPLY OPENJSON (column_name,'$') where JSON_VALUE(value,'$.Name') LIKE '%nilesh1%'
我這樣做了: