Skip to content

Instantly share code, notes, and snippets.

@yratof
Created October 10, 2014 12:56
Show Gist options
  • Save yratof/ef502f28e07cd94678d7 to your computer and use it in GitHub Desktop.
Save yratof/ef502f28e07cd94678d7 to your computer and use it in GitHub Desktop.
OMC Customers and their Emails SQL Query
SELECT n.invfname As 'First Name',n.invlname As 'Last Name',n.invcompname As 'Company',n.invtel As 'Tellephone Number',n.invadd1 As 'Address Line 1',n.invadd2 As 'Address Line 2',n.invtown As 'Town',n.invcounty As 'County',n.invpostcode As 'Postcode', e.custID AS 'ID', e.emailAddr AS 'Email Address', e.password AS 'Password'
FROM custaddressbook AS n
LEFT JOIN customers AS e
ON e.custID = n.custid
WHERE emailAddr IS NOT NULL
ORDER BY 'First Name'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment