mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-11-24 18:51:56 +01:00
54 lines
1.8 KiB
Plaintext
54 lines
1.8 KiB
Plaintext
|
|
|||
|
SELECT COUNT(FS_Rechnung) FROM tbl_trans
|
|||
|
SELECT name, COUNT(vorname) FROM tbl_personen group by name
|
|||
|
SELECT FS_Rechnung, COUNT(FS_Artikel) FROM tbl_trans GROUP BY FS_Rechnung
|
|||
|
|
|||
|
|
|||
|
|
|||
|
SELECT * FROM tbl_personen, tbl_rechnungen
|
|||
|
Beispiel f<>r einen Full-Join (kartesisches Produkt
|
|||
|
|
|||
|
SELECT * FROM tbl_personen, tbl_rechnungen
|
|||
|
WHERE tbl_personen.Person_ID = tbl_rechnungen.Person_FS
|
|||
|
|
|||
|
|
|||
|
SELECT * FROM tbl_personen INNER JOIN tbl_rechnungen
|
|||
|
ON tbl_personen.Person_ID = tbl_rechnungen.Person_FS
|
|||
|
|
|||
|
SELECT * FROM tbl_personen LEFT JOIN tbl_rechnungen
|
|||
|
ON tbl_personen.Person_ID = tbl_rechnungen.Person_FS
|
|||
|
|
|||
|
SELECT * FROM tbl_personen RIGHT JOIN tbl_rechnungen
|
|||
|
ON tbl_personen.Person_ID = tbl_rechnungen.Person_FS
|
|||
|
|
|||
|
|
|||
|
SELECT * FROM tbl_personen AS p INNER JOIN tbl_rechnungen AS r
|
|||
|
ON p.Person_ID = r.Person_FS
|
|||
|
INNER JOIN tbl_trans AS t ON r.Rechnungs_ID = t.FS_Rechnung
|
|||
|
ORDER BY Person_ID
|
|||
|
|
|||
|
SELECT * FROM tbl_personen AS p INNER JOIN tbl_rechnungen AS r
|
|||
|
ON p.Person_ID = r.Person_FS
|
|||
|
INNER JOIN tbl_trans AS t ON r.Rechnungs_ID = t.FS_Rechnung
|
|||
|
INNER JOIN tbl_artikel AS a ON t.FS_Artikel = a.Artikel_ID
|
|||
|
ORDER BY Person_ID
|
|||
|
|
|||
|
|
|||
|
SELECT * FROM tbl_personen AS p INNER JOIN tbl_rechnungen AS r
|
|||
|
ON p.Person_ID = r.Person_FS
|
|||
|
INNER JOIN tbl_trans AS t ON r.Rechnungs_ID = t.FS_Rechnung
|
|||
|
LEFT OUTER JOIN tbl_artikel AS a ON t.FS_Artikel = a.Artikel_ID
|
|||
|
ORDER BY Person_ID
|
|||
|
|
|||
|
|
|||
|
SELECT * FROM tbl_personen AS p INNER JOIN tbl_rechnungen AS r
|
|||
|
ON p.Person_ID = r.Person_FS
|
|||
|
LEFT OUTER JOIN tbl_trans AS t ON r.Rechnungs_ID = t.FS_Rechnung
|
|||
|
LEFT OUTER JOIN tbl_artikel AS a ON t.FS_Artikel = a.Artikel_ID
|
|||
|
ORDER BY Person_ID
|
|||
|
|
|||
|
SELECT * FROM tbl_personen AS p LEFT OUTER JOIN tbl_rechnungen AS r
|
|||
|
ON p.Person_ID = r.Person_FS
|
|||
|
LEFT OUTER JOIN tbl_trans AS t ON r.Rechnungs_ID = t.FS_Rechnung
|
|||
|
LEFT OUTER JOIN tbl_artikel AS a ON t.FS_Artikel = a.Artikel_ID
|
|||
|
ORDER BY Person_ID
|