I have three fields and if column three equals a certain value, I want to get the value of column 2. Can I do this in a SELECT, and would I use an IF or CASE statement?
I have three fields and if column three equals a certain value, I want
Share
A
CASEstatement would be the easiest way to do this. The following SQL compares two columns. You can alter this to useWHEN Col2 = 'xxxx' THEN xxxx'.