mercredi 24 juin 2015

SQL - Select integer in complex field (CAST and LIKE operators)

I have a table TabCustomer containing a number of fields.

One of these fields is a complex one named externalUser:

{"id":123,"companyID":12,"name":"Paul","surname":"Smith",...}

How can I select all the rows of this tab containing 123 as id;

I tried with CAST this way:

 SELECT * from tabCustomer WHERE CAST(externalUser.id AS VARCHAR(6)) LIKE '%id:"123"%'

but getting 0 results

Aucun commentaire:

Enregistrer un commentaire