tsql - Conditionals in transact-sql select column lists -
I have found a query that looks a bit like this:
records Select ID, Contacts. Name + '(' + contact 'organization' + ') As a contact, join on the records from Records. Record. Contact = contact Contact
The problem is - Use a CASE statement You can modify it to check tap values, but I believe that you do not have this problem because if you did not have a number in your contacts, Your entire result field is empty instead of the free space contact. Organization is often empty, and I get contacts like "John Smith ()" Is this just a way to incorporate the organization if it is not empty?
SELECT records.id, CASE contacts. The organization, when contacted in the name of "contact names, contact names as ELSE contacts.name + '(' + contact.organization + ')' END Records, on the Spaces Records .contact = contacts.contactid
Comments
Post a Comment