SELECT [ DISTINCT ] select_expr [, select_expr, ... ]
FROM table_ref [, table_ref ...]
[WHERE where_condition]
[GROUP BY column_def [ASC | DESC], ... ]
[HAVING group_by_where_condition]
[ORDER BY column_def [ASC | DESC], ... ]
[LIMIT row_count OFFSET offset ]
table_ref:
table_factor
| CROSS JOIN
| INNER JOIN table_factor ON conditional_expr
| { LEFT | RIGHT } JOIN table_factor ON conditional_expr
📚 SELECT
block-beta
columns 3
block:sources:3
columns 3
space:1
sourcestitle["Sources"]:1
space:1
block:source1
columns 5
s10[" "]
s11[" "]
s12[" "]
s13[" "]
s14[" "]
s15[" "]
s16[" "]
s17[" "]
s18[" "]
s19[" "]
end
block:source2
columns 5
s20[" "]
s21[" "]
s22[" "]
s23[" "]
s24[" "]
s25[" "]
s26[" "]
s27[" "]
s28[" "]
s29[" "]
end
block:source3
columns 5
s30[" "]
s31[" "]
s32[" "]
s33[" "]
s34[" "]
s35[" "]
s36[" "]
s37[" "]
s38[" "]
s39[" "]
end
end
space:3
block:merged:3
columns 1
mergedtitle["Fusion"]:1
block:merge1
columns 21
m110[" "]
m111[" "]
m112[" "]
m113[" "]
m114[" "]
m115[" "]
m116[" "]
m117[" "]
m118[" "]
m119[" "]
m120[" "]
m121[" "]
m122[" "]
m123[" "]
m124[" "]
m210[" "]
m211[" "]
m212[" "]
m213[" "]
m214[" "]
m215[" "]
m216[" "]
m217[" "]
m218[" "]
m219[" "]
m220[" "]
m221[" "]
m222[" "]
m223[" "]
m224[" "]
m310[" "]
m311[" "]
m312[" "]
m313[" "]
m314[" "]
m315[" "]
m316[" "]
m317[" "]
m318[" "]
m319[" "]
m320[" "]
m321[" "]
m322[" "]
m323[" "]
m324[" "]
m410[" "]
m411[" "]
m412[" "]
m413[" "]
m414[" "]
m415[" "]
m416[" "]
m417[" "]
m418[" "]
m419[" "]
m420[" "]
m421[" "]
m422[" "]
m423[" "]
m424[" "]
m510[" "]
m511[" "]
m512[" "]
m513[" "]
m514[" "]
m515[" "]
m516[" "]
m517[" "]
m518[" "]
m519[" "]
m520[" "]
m521[" "]
m522[" "]
m523[" "]
m524[" "]
m610[" "]
m611[" "]
m612[" "]
m613[" "]
m614[" "]
m615[" "]
m616[" "]
m617[" "]
m618[" "]
m619[" "]
m620[" "]
m621[" "]
m622[" "]
m623[" "]
m624[" "]
m10[" "]
m11[" "]
m12[" "]
m13[" "]
m14[" "]
m15[" "]
m16[" "]
m17[" "]
m18[" "]
m19[" "]
m20[" "]
m21[" "]
m22[" "]
m23[" "]
m24[" "]
end
end
space:3
block:filtered:3
columns 1
filteredtitle["Filtre"]:1
block:filtered1
columns 21
f110[" "]
f111[" "]
f112[" "]
f113[" "]
f114[" "]
f115[" "]
f116[" "]
f117[" "]
f118[" "]
f119[" "]
f120[" "]
f121[" "]
f122[" "]
f123[" "]
f124[" "]
f210[" "]
f211[" "]
f212[" "]
f213[" "]
f214[" "]
f215[" "]
f216[" "]
f217[" "]
f218[" "]
f219[" "]
f220[" "]
f221[" "]
f222[" "]
f223[" "]
f224[" "]
f310[" "]
f311[" "]
f312[" "]
f313[" "]
f314[" "]
f315[" "]
f316[" "]
f317[" "]
f318[" "]
f319[" "]
f320[" "]
f321[" "]
f410[" "]
f411[" "]
f412[" "]
f413[" "]
f414[" "]
f415[" "]
f416[" "]
f417[" "]
f418[" "]
f419[" "]
f420[" "]
f421[" "]
f510[" "]
f511[" "]
f512[" "]
f513[" "]
f514[" "]
f515[" "]
f516[" "]
f517[" "]
f518[" "]
f519[" "]
f520[" "]
f521[" "]
f610[" "]
f611[" "]
f612[" "]
f613[" "]
f614[" "]
f615[" "]
f616[" "]
f617[" "]
f618[" "]
f619[" "]
f620[" "]
f621[" "]
f622[" "]
f623[" "]
f624[" "]
f625[" "]
f626[" "]
f627[" "]
f10[" "]
f11[" "]
f12[" "]
f13[" "]
f14[" "]
f15[" "]
f16[" "]
f17[" "]
f18[" "]
f19[" "]
f20[" "]
f21[" "]
f22[" "]
f23[" "]
f24[" "]
f25[" "]
f26[" "]
f27[" "]
f28[" "]
f29[" "]
f30[" "]
end
end
class f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f23,f24,f25,f26,f27,f28,f29,f30 red
classDef red stroke:red
space:3
block:selected:3
columns 1
selectedtitle["Sélection"]:1
block:selected1
columns 5
s110[" "]
s111[" "]
s112[" "]
s113[" "]
s114[" "]
s115[" "]
s116[" "]
s117[" "]
s118[" "]
s119[" "]
s210[" "]
s211[" "]
s212[" "]
s213[" "]
s214[" "]
s215[" "]
s216[" "]
s217[" "]
s218[" "]
s219[" "]
end
end
space:3
block:grouped:3
columns 3
space:1
groupedtitle["Aggrégation"]:1
space:1
block:group1
columns 5
g10[" "]
g11[" "]
g12[" "]
g13[" "]
g14[" "]
end
block:group2
columns 5
g20[" "]
g21[" "]
g22[" "]
g23[" "]
g24[" "]
end
block:group3
columns 5
g30[" "]
g31[" "]
g32[" "]
g33[" "]
g34[" "]
g35[" "]
g36[" "]
g37[" "]
g38[" "]
g39[" "]
end
end
style group1 stroke:blue
style group2 stroke:green
style group3 stroke:orange
space:3
block:having:3
columns 1
havingtitle["Filtrer groupes"]:1
block:hgroup
columns 5
h0[" "]
h1[" "]
h2[" "]
h3[" "]
h4[" "]
h5[" "]
h6[" "]
h7[" "]
h8[" "]
h9[" "]
end
end
classDef orange stroke:orange
classDef blue stroke:blue
class h0,h1,h2,h3,h4 blue
class h5,h6,h7,h8,h9 orange
space:3
block:ordered:3
columns 1
orderedtitle["Trier"]:1
block:order
columns 5
o5[" "]
o6[" "]
o7[" "]
o8[" "]
o9[" "]
o0[" "]
o1[" "]
o2[" "]
o3[" "]
o4[" "]
end
end
class o0,o1,o2,o3,o4 blue
class o5,o6,o7,o8,o9 orange
space:3
block:limited:3
columns 1
limitedtitle["Restreint"]:1
block:limit
columns 5
l5[" "]
l6[" "]
l7[" "]
l8[" "]
l9[" "]
end
end
class l5,l6,l7,l8,l9 orange
sources --"from, join"--> merged
merged --"where"--> filtered
filtered --"select, distinct"--> selected
selected --"group by"--> grouped
grouped --"having"--> having
having --"order by"--> ordered
order --"limit"--> limited
classDef nobox fill:none,stroke:none,font-size:larger;
class sources,sourcestitle nobox
class merged,mergedtitle nobox
class filtered,filteredtitle nobox
class selected,selectedtitle nobox
class grouped,groupedtitle nobox
class having,havingtitle nobox
class ordered,orderedtitle nobox
class limited,limitedtitle nobox