Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL table aliases #1

Open
cyouh95 opened this issue Jun 19, 2018 · 0 comments
Open

SQL table aliases #1

cyouh95 opened this issue Jun 19, 2018 · 0 comments

Comments

@cyouh95
Copy link

cyouh95 commented Jun 19, 2018

You could also use table aliases to avoid having to write out the full name each time:

SELECT v.first_name, ... f.fitness_test_date, ...
FROM visits v
    LEFT JOIN fitness_tests f
        ON v.email=f.email
        AND v.first_name=f.first_name
        AND v.last_name=f.last_name
    ...
WHERE v.visit_date >= '7-1-17';

https://github.com/matthewboehlke/intro-data-capstone-musclehub/blob/master/Intro_To_Data_Analysis_Matt_Boehlke/musclehub.py#L121-L135

@cyouh95 cyouh95 mentioned this issue Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant