sql - Select all tuples of a Table, with a dummy column showing which tuples satisfy a condition -
if add condition in query gives me filtered results. need result in rows (filtered + unfiltered) shown additional (dummy) column tells me means(say boolean value) specific row met "where condition" .
taking example where
condition:
where col1 = 2
use case
add additional column indicating if condition met:
select *, case when col1 = 2 'true' else 'false' end `dummy` your_table
Comments
Post a Comment