Number mapping and IF in SQL
Posted on 1999-06-25
Hi, I know very little about SQL, and I have the following 2 similar questions:
1). How do I map a number to a string in a query ? That is, I have a field called [STATUS] in my table. I want to create a SQL statement ("SELECT blah as blah from MYTABLE blah") which will put "One" in the Status column if [STATUS]=1, "Two" if [STATUS]=2, etc.
2). I have two other fields, up to two of which can be empty (that is, ""). I want to create a SQL statement that will put [FIELD1] in the Result column if it is nonempty; otherwise, it will put [FIELD2] in the Result column.