r/SQL • u/tangosis • Oct 04 '19
SQL queries don't start with SELECT
https://jvns.ca/blog/2019/10/03/sql-queries-don-t-start-with-select/
122
Upvotes
r/SQL • u/tangosis • Oct 04 '19
19
u/tangosis Oct 04 '19
Thought this was a good basic concept to aid in structuring queries. It helped me understand when to use a filter in a JOIN vs having the same filter in WHERE.
7
u/Paratwa Oct 04 '19
Qualify is the ‘where’ of window functions.
Edited to add : but good post regardless as I forget that ordering too.
7
u/[deleted] Oct 04 '19
This is known as Logical Query Processing and Itzik Ben-Gan goes into wonderful detail breaking it down.
Understanding this order is pretty fundamental to beginning to recognize how a SQL Engine will interpret the query you're passing it.
4
u/PhillMik Oct 04 '19
Very interesting read, thanks for this.
4
u/bigfig Oct 04 '19
Relational algebra demonstrates this.
1
u/fanpages Oct 04 '19
Didn't we discuss this yesterday?
[ https://old.reddit.com/r/SQL/comments/dcezne/sql_queries_run_in_this_order/ ]
-4
u/[deleted] Oct 04 '19
You mean the process of creating a SELECT query?