I want to find all the columns in my table which have value '1'.
I want to find all the columns in my table which have value '1'. i have a table which has various columns [form fields], in this table I am also specifying whether it should be editable/shown. If the value is '1' for "ShowProcess" ; it means the column process is shown in UI. Now I want all the columns in which the value is '1' based on a column called processID
In general, it's best to not think of queries based on selectively picking columns. You filter rows worth of data. Then, if you want to format the output, you do that in the client. So you have a processID column that you want to return all values of 1 for it, and all your other columns, which you can then decide which get displayed later. SELECT mt.* FROM dbo.MyTable AS mt WHERE mt.processID = 1;