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

129
Views
Cómo buscar datos específicos dentro de datos JSON en la tabla

Tengo una tabla llamada carts que tiene esta estructura:

 1 crt_id Primary bigint(20) 2 crt_mbr_id bigint(20) 3 crt_session_id varchar(128) 4 crt_content text 5 crt_send_type int(11) 6 crt_completed tinyint(1) 7 created_at timestamp 8 updated_at timestamp

Y los datos de crt_content son así:

[{"id":"24","quantity":"1","price":3000,"discounted":3000,"coupon":0}]

Ahora necesito buscar en crt_content el número 24 . Pero no sé cuál es el comando sql para esto.

Entonces, ¿te importaría ayudarme a buscar datos específicos dentro de los datos JSON que se almacenan en la tabla?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puede usar la función JSON_EXTRACT como se muestra a continuación en su cláusula where:

 JSON_EXTRACT(crt_content, "$.id") = "24"

Sin embargo, me gustaría advertirle que no recomendaría esto como una solución que contenga una gran cantidad de datos. Si desea leer más sobre las funciones de búsqueda JSON, eche un vistazo aquí .

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!