I have 2 tables, illustrated by queries:
CT_Validation
select ValidationID, Message from CT_Validation
ValidationID Message
======================================================
IP_Validator Not a valid IP address
NumbersOnly Invalid number.
SSN Not a valid social security number.
10Digits A 10-digit number is required.
CT_Validation_Lang
select ValidationID, LangID, Message from CT_Validation_Lang
ValidationID LangID Message
======================================================
SSN es Peligro es mi segundo nombre!
How would I build a join so that if LangID = 'es'
I would get back:
ValidationID Message
======================================================
IP_Validator Not a valid IP address
NumbersOnly Invalid number.
SSN Peligro es mi segundo nombre!
10Digits A 10-digit number is required.
...but if LangID
is blank, null, or anything other than 'es', the results would revert to all English:
ValidationID Message
======================================================
IP_Validator Not a valid IP address
NumbersOnly Invalid number.
SSN Not a valid social security number.
10Digits A 10-digit number is required.
Important: The key field is ValidationID
and the important key value in this example is SSN
because that exists in both tables.
Thanks in advance for any advice.