Skip to content
Advertisement

how to use wildcard for a column jsonb type

I have a table (named profile) in my Postgres database, which has 3 columns: ID, Day, Ftfm_profile of type jsonb, I tried to extract the row where the profile name (ftfm_profile->'name') begins with ‘LFBB’ ( sql: LFBB%) using the wildcard as following:

the expected result:

I can’t seem to find the solution, thanks for your help

Advertisement

Answer

One option unnests the json arrray in an exists subquery:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement