select query
Hi,
I have a table with 2 fields:
passport varchar
idNo numeric
I have to display the fields in one column
If idNo is null then I want to show the passport number in the column but if neither passport or idNo are null then I want to show the idNo.
I tried the following select query but it only works if both fields are numeric and i can't change the data type for one of the fields as it will coz huge problems:
select idno,passport,
(case when idno is null then passport else idno end) as sid
from student
How can I make it work?
Thanks
|