Skip to content

Instantly share code, notes, and snippets.

@madx
Created October 14, 2009 09:18
Show Gist options
  • Save madx/209914 to your computer and use it in GitHub Desktop.
Save madx/209914 to your computer and use it in GitHub Desktop.
SELECT NumPil, NumAv
FROM Vols
WHERE NumPil IS NOT NULL AND NumAv IS NOT NULL
GROUP BY NumPil, NumAv
ORDER BY NumPil;
AVIONS (#NumAv, NomAv, CapAv, VilleAv)
PILOTES (#NumPil, NomPil, NaisPil, VillePil)
VOLS (#NumVol, VilleD, VilleA, DateD, DateA, NumPil, NumAv, CoutVol)
SELECT NumPil, COUNT(*)
FROM (
SELECT NumPil, NumAv
FROM Vols
WHERE NumPil IS NOT NULL AND NumAv IS NOT NULL
GROUP BY NumPil, NumAv
ORDER BY NumPil
)
GROUP BY NumPil;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment