I want to select columns from a table conditionally,I Just followed this link,
SELECT ID,(CASE WHEN @check=0
THEN Teacher END) 'Teacher'
FROM Register
Result when @check =1
---------------------
| ID | Teacher |
---------------------
| 10 | NULL |
| 20 | NULL |
--------------------
In this case I don't want to select Teacher
Column,How to do this?
If it is not possible How to delete column which has null value for all row ?