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

296
Views
Cómo obtener una nueva columna en el caso en postgresql

Tengo una tabla con fecha de startdate y fecha de enddate .

donde la fecha de inicio es mayor que la fecha de finalización, necesito calcular el total de días como 30; de lo contrario, (fecha de finalización - fecha de inicio) + 1 ... ¿cómo creo una declaración de caso para ello?

 Select case when 'startdate > enddate' then 30 when 'startdate > enddate' then (fine_fatturazione - startdate )+1 end as td from table1 startdate enddate 04-10-2015 04-12-2015 10-07-2015 09-08-2015 05-12-2015 04-01-2016 07-02-2016 04-01-2016
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Select case when table1.startdate > table1.enddate then 30 else table1.enddate - table1.startdate + 1 end as td from table1
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!