Skip to content
Advertisement

SQL – add blank column and populate based on value in calculated datediff column

I am very very new to SQL and also self taught….so be clear please. I’m trying to add a blank column within my Data that will show if the number in the days column is:

Between 15-21 AS 15-21 days ,22-28 days AS 22-28 days ,>28 days AS breached

I can get a blank column by using ' ' AS Status. I just need to know how to populate it

Advertisement

Answer

Why don’t you do them in one select, without unions, and use this technique?

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement