How can I make this structure in Json from SQL 2017?

0

I want to convert this structure by selecting data from the table when I select it, I am going to convert it into JSON from database Sql 2017. ATTACHMENT MY QUERY

Select Medio_Pago AS [medio_pago] from Table_FacturacionElect 
where Comprobante = '22'  FOR JSON PATH,WITHOUT_ARRAY_WRAPPER 

I wish to have this result excato

 "medio_pago": [
        "sample string 1"
      ],
    
asked by Jurgem 29.11.2018 в 02:34
source

1 answer

0
SELECT JSON_QUERY(CONCAT('["',Medio_Pago,'"]')) ValidityPeriod 
from Table_FacturacionElect 
where Comprobante = '22' 
FOR JSON PATH, WITHOUT_ARRAY_WRAPPER

Use this query to have this result.

    
answered by 29.11.2018 в 22:56