I have this table
Column1 Column2
1 value1
2 value2
3 value3
4 value4
Using this statement:
SELECT * FROM table WHERE column2='value2'
Only displays this:
Column1 Column2
2 value2
I want to display this:
Column1 Column2
1
2 value2
3
4
How?
Well, your
WHEREclause is saying “show me the rows wherecolumn2 = value2” – so, as written, it can’t possibly include any rows wherecolumn2has any other value, because they’ve been filtered out.Here’s one way to accomplish what you’re looking for, using a
CASEexpression (and noWHEREclause):