-
SQL Help
I want to create a query that uses a condition in the Select statement to determine which field is selected.
Lets say I have two columns in a table: ColA and ColB. I want to create a select statement that selects ColA if it is not null or ColB if it is null. It would be similar to the IIF statement. I think I've seen it done before, but I can't remember where.
Please Help.
Thanks in Advance,
Chris
-
SQL Help (reply)
SELECT isnull(colA,colB) FROM table
------------
CWB at 6/25/01 4:17:52 PM
I want to create a query that uses a condition in the Select statement to determine which field is selected.
Lets say I have two columns in a table: ColA and ColB. I want to create a select statement that selects ColA if it is not null or ColB if it is null. It would be similar to the IIF statement. I think I've seen it done before, but I can't remember where.
Please Help.
Thanks in Advance,
Chris
-
SQL Help (reply)
Look up 'IF/Else' in the books online. I'm assuming you are using other criteria in a WHERE statement to SELECT your row.
------------
CWB at 6/25/01 4:17:52 PM
I want to create a query that uses a condition in the Select statement to determine which field is selected.
Lets say I have two columns in a table: ColA and ColB. I want to create a select statement that selects ColA if it is not null or ColB if it is null. It would be similar to the IIF statement. I think I've seen it done before, but I can't remember where.
Please Help.
Thanks in Advance,
Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|