add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
DECLARE @json1 nvarchar(max) = '{
"personalLoans":{
"loans":[]
},
"loanHistory":{
"loans":[
{
"role":"Kredimarrës",
"type":"1"
},
{
"role":"Kredimarrës",
"type":"2"
},
{
"role":"Kredimarrës",
"type":"3"
},
{
"role":"Tjetër",
"type":"4"
}
]
}
}';

SELECT *
FROM OPENJSON(@json1, '$.loanHistory.loans')
WITH (
role nvarchar(100),
type int
) h
WHERE h.role = N'Kredimarrës';
role type
Kredimarrës 1
Kredimarrës 2
Kredimarrës 3