none
Need help with json query RRS feed

  • Question

  • Hi All

    I am new to JSon query and I am not sure how to get my head around this. Will appreciate for any help provided.

    I have a JSON QUERY

    {\"preferredBuCode\":\"082\",\"loyaltyProgram\":{\"loyaltyCardList\":[{\"cardType\":\"FAMILY\",\"cardNo\":\"6275980183224536000\"}]},

    I am trying to get the card no by using select statement and also using JSON query in my select statementalso group them by dates(let say from 1st oct - 5th oct)

    How can I do it

    Please help with the actual sql query please , I am not able to get an answer

    What I have tried is this

    select

    count(*)rec,cast(created_date asdate)DATE,JSON_query(data,'$."cardNo"')ascard_no

    from

    #temp_update

    group

    bycast(created_date asdate),JSON_query(data,'$."cardNo"')

    So data is the json query and the json I have written above is an example

    Regards

    Farhan Jamil

    Tuesday, October 15, 2019 1:50 PM

Answers