[
{
"Level" : "S1",
"Major" : "Teknik Informatika"
},
{
"Level" : "SMA",
"Major" : "IPA"
},
{
"Level" : "SMP",
"Major" : "Umum"
},
{
"Level" : "SD",
"Major" : "Umum"
}
]
iD | UserID | Education
------------------------------------------------------------------------------
1 | B000-1 | [{"Level":"S1","Major":"TI"},{"Level":"SMA","Major":"IPA"}]
2 | B000-2 | [{"Level":"SMA","Major":"IPS"},{"Level":"SD","Major":"Umum"}]
3 | B000-3 | [{"Level":"SMA","Major":"IPA"}]
4 | B000-4 | [{"Level":"SD","Major":"Umum"}]
Jika setiap kolom table Education kurang lebih berisi seperti object diatas, bagaimana saya mencari data Education[Level]='SMA' tanpa menggunakan OPENJSON, karena saya menggunakan sql server 2012
Translate :
If every column in Education table contains objects like above, how can I find Education[Level]='SMA' without using OPENJSON, because I am using SQL Server 2012
iD | UserID | Education
------------------------------------------------------------------------------
1 | B000-1 | [{"Level":"S1","Major":"TI"},{"Level":"SMA","Major":"IPA"}]
2 | B000-2 | [{"Level":"SMA","Major":"IPS"},{"Level":"SD","Major":"Umum"}]
3 | B000-3 | [{"Level":"SMA","Major":"IPA"}]
LIKE?WHERE Education LIKE '"Level":"SMA"... Will it work with your data type forEducationcolumn?LIKEdirectly, you canCASTthe column tovarchar.nvarchar(MAX)LIKEapproach