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

185
Views
json_array_elements: sintaxis de entrada no válida para entero

Tengo los siguientes datos de muestra para la demostración:

Mesa :

 create table tbl_json ( id json );

Algunos valores:

 insert into tbl_json values('[{"id":1},{"id":2},{"id":3}]');

Consulta : convertir/convertir id en integer de la columna json.

Intenté :

 select json_array_elements(id)->>'id'::int ids from tbl_json;

Obteniendo un error:

ERROR: invalid input syntax for integer: "id"

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

La ::int se aplica a 'id' porque tiene una precedencia más alta.

 select (json_array_elements(id)->>'id')::int ids from tbl_json;
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!