Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

475
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda