Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle NVL Look for Certain Value else blank Equivalent in Mysql

Status
Not open for further replies.

kernal

Technical User
Feb 27, 2001
415
US
In Oracle, I can have in the criteria:

test_table.id = email_table.id (+)
AND
NVL(email_table.primary_email(+),'Y')

WHAT IT DOES:

If the test_table.id and email_table.id is the same and the email_table.primary_email='Y' then have 'Y' else '' in the email_table.primary_email results so example:

test_table.id email_table.id email_table.primary_email
1 1 Y
2 NO 2 in table blank
3 3 blank (IDs in both tables but email_table.primary_email='N' so blank)

Is there a way to do this in Mysql?

Help is very appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top