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

108
Views
Actualizar 1 columna de otra tabla

¿Cómo puedo hacer una actualización? Aquí está el código, eso no funciona. (Tres tablas locales son viables, no puedo hacer la última consulta usando la actualización)

 WITH allowedIds AS ( SELECT client_id as id FROM cardHistory WHERE ( (now())::date -(date_set)::date )::int > 1095 ), thirtyPercents AS ( SELECT a.id, ( ( (card_period[2][1])::date - (card_period[1][1])::date)::double precision / 10 ) * 3 AS percent FROM client a, allowedIds b WHERE a.id = b.id ), dataSets AS ( select a.id, (a.card_period[2][1] + ( (b.percent)::int * interval '1 day' ) ) as newDate from client a, thirtyPercents b where a.id = b.id ) UPDATE client SET a.card_period[2][1] = b.newDate FROM dataSets b INNER JOIN client a ON a.id = b.id;
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Creo que quieres esto:

 UPDATE client SET card_period[2][1] = b.newDate FROM dataSets d WHERE client.id = d.id;

Tenga en cuenta que el client no se menciona dos veces en la consulta.

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!