Created
June 5, 2020 17:02
-
-
Save Kristjan-Reinsberg/d3dab52258ff42a2345fab460cbb8619 to your computer and use it in GitHub Desktop.
SQL until first occurance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT DISTINCT | |
| clients.papers_email_address, | |
| LEFT(clients.name , LOCATE(' ',clients.name) - 1) AS eesnimi_tyhikuni /* MARI TAMM -> MARI (täisnime hoitakse)*/ | |
| FROM | |
| policies | |
| LEFT JOIN clients ON clients.id = policies.client_id | |
| WHERE | |
| policies.end_date > '2020-06-08' | |
| AND clients.papers_email_address IS NOT NULL | |
| AND clients.papers_email_address != '' | |
| AND clients.client_codetype_id = 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment