Sektion 1. Kapitel 33
single
Challenge: Find Users by City
Stryg for at vise menuen
Opgave
Swipe to start coding
Write a query to find users whose address city in the profile_data JSONB column is 'New York' using PostgreSQL JSON operators.
- Query the
user_profilestable. - Use PostgreSQL JSON operators (
->and->>) to access the nestedcityfield inside theaddressobject in theprofile_datacolumn. - Filter for rows where the
address.cityvalue is'Springfield'. - Return the
user_idandprofile_datacolumns for all matching users.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 33
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat