Home > database >  How to use SQL to solve many filter
How to use SQL to solve many filter

Time:09-24

Sales date, the date of 1, registration date;

Mainly sales date, date in some cases can choose sales date 1 or registration date
When the sales date is empty choose sales date 1,
When the registration date is empty to choose registration date
If have no empty, this how to use SQL to show,

CodePudding user response:

COALESCE (date of sales, sales date 1, registration date)

CodePudding user response:

The original poster should write wrong description logic,

CodePudding user response:

Use case:
Select case when then 1=2 'aaa' when 1=3 then 'BBB' else 'CCC' from dual;
  • Related