Have someone help me please!!
How can I filter the date like row 2 and row 5(row 7 and row 8) and also I couldn't make same column on the result of query ? Have someone can help me please?
My query statement as below:
SELECT DISTINCT C.FCommonName , A.BCommonName as BCommonName1, B.BCommonName as BCommonName2
FROM BIRDS A, BIRDS B, Families C
where B.FCODE = A.FCODE
and A.FCODE = C.FCODE
and A.BCommonName <> B.BCommonName
The result as below:
FCommonName BCommonName1 BCommonName2
---------------- ------------------------ ------------------------
Albatrosses Black Browed Albatross Shy Albatross
Albatrosses Black Browed Albatross Wandering Albatross
Albatrosses Shy Albatross Black Browed Albatross
Albatrosses Shy Albatross Wandering Albatross
Albatrosses Wandering Albatross Black Browed Albatross
Albatrosses Wandering Albatross Shy Albatross
Broad Tailed Parrots Budgeriagar Cockatiel
Broad Tailed Parrots Cockatiel Budgeriagar
This query is about type of birds that belong to the same family. Where this occurs, display the family's common name (FCommonName) and then the bird's common names (BCommonName) in pairs, in the style shown below.
FCommonName BCommonName BCommonName
------------------------------ -------------------------- --------------------------
Albatrosses Black Browed Albatross Shy Albatross
Albatrosses Wandering Albatross Black Browed Albatross
Albatrosses Wandering Albatross Shy Albatross
Broad Tailed Parrots Cockatiel Budgeriagar
Cormorants Great Cormorant Pied Cormorant
Eagles, Kites & Goshawks White BelliedSeaEagle Wedge Tailed Eagle
Fairy Wrens Superb Fairy Wren Red Backed Fairy Wren
Falcons Peregrine Falcon Australian Kestrel
Geese, Swans & Ducks Black Swan Pacific Black Duck
Geese, Swans & Ducks Black Swan Maned Wood Duck
Geese, Swans & Ducks Pacific Black Duck Maned Wood Duck
NB:
Do not show the same pair of birds more than once. For example, it would be wrong if the first row above appeared as the two rows below:
FCommonName BCommonName BCommonName
--------------------- ------------------------ ----------------------
Albatrosses Black Browed Albatross Shy Albatross
Albatrosses Shy Albatross Black Browed Albatross
|