1SELECT TableA.*, TableB.*, TableC.*, TableD.*
2FROM TableA
3 JOIN TableB
4 ON TableB.aID = TableA.aID
5 JOIN TableC
6 ON TableC.cID = TableB.cID
7 JOIN TableD
8 ON TableD.dID = TableA.dID
9WHERE DATE(TableC.date)=date(now())
10
1SELECT t1.ks, t1.[# Tasks], COALESCE(t2.[# Late], 0) AS [# Late]
2FROM
3 (SELECT ks, COUNT(*) AS '# Tasks' FROM Table GROUP BY ks) t1
4LEFT JOIN
5 (SELECT ks, COUNT(*) AS '# Late' FROM Table WHERE Age > Palt GROUP BY ks) t2
6ON (t1.ks = t2.ks);
7
1SELECT Books_Namn, Author_Namn, Author_Age, Store_Namn FROM books
2
3JOIN Author ON Author_Id = Author_Author_Id
4
5JOIN Books_has_Store ON Books_Books_Id = Books_Id
6
7JOIN Store ON Store_Id = Store_Store_Id;