Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

476
Views
Search value from json in sqlite - Android

I have table named User contain column named userDetails. userDetails column having data in json format like below.

{
    "id": "77",
    "uid": "247",
    "email": "abc@xyz.com",
}

How to query like 'where uid = 247' which is present in this json object.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If the column userDetails is a valid JSON string, you can use the function json_extract():

select * 
from user
where json_extract(userDetails, '$.uid') = '247' 

If you can't use SQLite's JSON1 extension, you can do it by treating userDetails as a normal string and use the operator LIKE:

select * 
from user
where ',' || replace(replace(replace(userDetails, '{', ''), '}', ''), ' ', '') || ',' like '%,"uid":"' || '247' ||'",%'

Replace the ? placeholder with the id you search for, like '247'.

See a simplified demo.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!