1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| SELECT Persons.IdPerson, Persons.Lastname, Persons.Firstname, Persons.Society,
Persons.Phone1, Persons.Phone2, Persons.Phone3, Persons.FuncGrp1, Persons.FuncGrp2, Persons.FuncGrp3,
FuncGrp.FuncGrpName, FuncGrp_2.FuncGrpName AS FuncGrpName2 , FuncGrp_3.FuncGrpName AS FuncGrpName3
FROM ((Persons
LEFT JOIN FuncGrp ON Persons.FuncGrp1 = FuncGrp.IdFuncGrp)
LEFT JOIN FuncGrp AS FuncGrp_2 ON Persons.FuncGrp2 = FuncGrp_2.IdFuncGrp)
LEFT JOIN FuncGrp AS FuncGrp_3 ON Persons.FuncGrp3 = FuncGrp_1.IdFuncGrp
WHERE (Persons.Lastname LIKE 'Filter1%' OR Persons.Firstname Like 'Filter1%' )
AND Persons.Society like 'Filter2'
AND (FuncGrp.FuncGrpName like 'Filter3' OR FuncGrp_2.FuncGrpName LIKE 'Filter3' OR FuncGrp_3.FuncGrpName like 'Filter3')
AND (Persons.Phone1 LIKE '%Filter4%' OR Persons.Phone2 like '%Filter4%' OR Persons.Phone3 LIKE '%Filter4%')
ORDER BY Lastname ASC |
Partager