I am using this query.
In database structure column_name into Json format like this :
[
{
"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"
}
]
I have to use below query with Laravel eloquent:
select [customername] as [customerName]
from [opf_details]
CROSS APPLY OPENJSON (column_name,'$') where JSON_VALUE(value,'$.Name') LIKE '%nilesh1%'
2
Answers
you can use
whereRaw()
with thecrossJoin()
crossJoin()
whereRaw()
Edit
I have done like this: