Qwerty8989
Registered User.
- Local time
- Today, 05:26
- Joined
- Oct 17, 2006
- Messages
- 11
I am wanting to display the heighest tree giving the name of the tree, its height, which supplier supplies it including the suppliers name and address. I know I need a MAX in there somewhere, however, this shows what I want:
SELECT PLANTEN.PLANTNAAM, PLANTEN.SOORT, PLANTEN.HOOGTE, LEVERANC.LEV_NAAM, LEVERANC.ADRES
FROM PLANTEN INNER JOIN (LEVERANC INNER JOIN OFFERTES ON LEVERANC.LEV_CODE = OFFERTES.LEV_CODE) ON PLANTEN.ART_CODE = OFFERTES.ART_CO
WHERE (PLANTEN.SOORT='boom' AND PLANTEN.HOOGTE=4000);
The last bit PLANTEN.HOOGTE=4000 (this being the height of the tree) isn't what I need since it will only show that tree even if higher trees are added. Therefore I know I need a SELECT MAX(PLANTEN.HOOGTE) FROM PLANTEN somewhere, but when I try to do it I get the wrong results. Any suggestions would be appreciated =)
SELECT PLANTEN.PLANTNAAM, PLANTEN.SOORT, PLANTEN.HOOGTE, LEVERANC.LEV_NAAM, LEVERANC.ADRES
FROM PLANTEN INNER JOIN (LEVERANC INNER JOIN OFFERTES ON LEVERANC.LEV_CODE = OFFERTES.LEV_CODE) ON PLANTEN.ART_CODE = OFFERTES.ART_CO
WHERE (PLANTEN.SOORT='boom' AND PLANTEN.HOOGTE=4000);
The last bit PLANTEN.HOOGTE=4000 (this being the height of the tree) isn't what I need since it will only show that tree even if higher trees are added. Therefore I know I need a SELECT MAX(PLANTEN.HOOGTE) FROM PLANTEN somewhere, but when I try to do it I get the wrong results. Any suggestions would be appreciated =)