Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FULL OUTER JOIN?

Status
Not open for further replies.

piti

Technical User
Apr 12, 2001
627
SK
hi there
i need to perform full outer join but mysql keeps returning errors
anybody knows how to do that?
 
well here's my query string:
---------------------
SELECT
CASE
WHEN TempObjekty.IdObjektu Is Not Null THEN TempObjekty.VzdialenostObjektValue
ELSE
CASE
WHEN TempObce.VzdialenostObecValue>=1000 THEN CONCAT(TempObce.VzdialenostObecValue/1000, ' km')
WHEN TempObce.VzdialenostObecValue=0 OR TempObce.VzdialenostObecValue Is Null THEN ''
ELSE CONCAT(TempObce.VzdialenostObecValue, ' m')
END
END,
FilterObjektovTbl.TypUbytovania,
FilterObjektovTbl.IdObjektu,
TempObce.IdObce,
TempObce.MenoObce
FROM
TempObce
INNER JOIN FilterObjektovTbl ON TempObce.IdObce = FilterObjektovTbl.IdObce
OUTER JOIN TempObjekty ON FilterObjektovTbl.IdObjektu = TempObjekty.IdObjektu
ORDER BY
CASE
WHEN TempObjekty.IdObjektu Is Not Null THEN VzdialenostSort
ELSE TempObce.VzdialenostObecValue
END

---------------------
i need outer join with condition
when i try to do the same like this, which i was told should act like i want, it returns everything from FilterObjektovTbl

FROM
FilterObjektovTbl
LEFT JOIN TempObce ON TempObce.IdObce = FilterObjektovTbl.IdObce
LEFT JOIN TempObjekty ON TempObjekty.IdObjektu = FilterObjektovTbl.IdObjektu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top