MySQL Forums
Forum List  »  Newbie

Question about query involving null values
Posted by: Jeffrey Roden
Date: March 27, 2016 10:31AM

I'm new to MySQL and am just migrating from Microsoft Access. Obviously, the way Access and MySQL handle queries is different. I have a people table where I have names in 3 columns, being LastName, FirstName and PreferredFirstName. In Access, I concatenate these in a query to produce the result FullPreferredName. Here's my Access query:

SELECT
IIf([PreferredFirstName] Is Not Null,
[LastName] &", "&[PreferredFirstName],
[LastName] &", "&[FirstName]
AS
FulPreferredName

Obviously, the MySQL statements will be different, as well as how it concatenates columns together. I've search everywhere and can't seem to get it right. Thanks in advance for the help.

Options: ReplyQuote


Subject
Written By
Posted
Question about query involving null values
March 27, 2016 10:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.