我需要一個SQL stament會給我這樣的事情,其中一個字段是否爲空,它不這樣做的加入我需要做一個SQL如果然後其他連接表,如果該字段不爲空?
SELECT AdminID,tblapartments.NameNo, tblgarages.GarageID, tblclients.Name FROM tbladmin,tblclients,tblgarages,tblapartments WHERE tblclients.ClientID =tbladmin.ClientID AND
IF (tbladmin.ApartmentID != null)
{
tblapartments.ApartmentID = tbladmin.ApartmentID
}
AND If(tbladmin.GarageID != Null)
{
tblgarges.GarageID = tbladmin.GarageID
}
你爲什麼不試試內連接加入 – 2011-12-13 18:56:33
我該怎麼做? – owen 2011-12-13 18:58:02
我是新來的sql:S – owen 2011-12-13 18:58:09