I've never seen this SQL syntax:
select
column1,
case
when table1.column1 is not null then 1
when table2.column1 is not null then 2
when table0.column1 is not null then 0
end as column_nameX,
...
column1,
case
when table1.column1 is not null then 1
when table2.column1 is not null then 2
when table0.column1 is not null then 0
end as column_nameX,
...
Have you?
yes, I have
and I use it when appropriate. Your example is not very good but this could be used widely in views to facilitate data understanding. For instance if you have several bit fields for describe why some operation failed you could add calculated column with IF statement of CASE statement to present a better result.
Of course this is not very good in large databases because filtering by this column will cause full table scan
Yea, it looks like it could get ugly.
I'm wondering why didn't we study it our Database course in the University.
Hey. If a free society cannot help the many who are poor, it cannot save the few who are rich.
I am from Cape and also now am reading in English, give please true I wrote the following sentence: "Retirement, risks should draw up to their payment - at least that's the superintendency."
Regards 🙁 Early retirement forum.