mysql - Want to add multiple variables to myql AND function -


a screenshot: enter image description here

hi want add number functie.code = results of people functie.code = 3 4 , 5.

but how should this?

select distinct voornaam,achternaam,provincie,functie.naam,max(provincie) medewerker,functie,persoon,adres medewerker.functie_code = functie.code , medewerker.persoon_idpersoon = persoon.idpersoon , persoon.adres_idadres = adres.idadres , functie.code in ( 3, 4, 5) 

thanks in advance

you have max() in select. turns query aggregation query without group by -- returns 1 row.

in addition, using archaic join syntax. simple rule: don't use commas in from clause.

a query presumably want:

select voornaam, achternaam, provincie, f.naam, provincie medewerker m join      functie f      on m.functie_code = f.code join      persoon p      on m.persoon_idpersoon = p.idpersoon join      adres      on p.adres_idadres = a.idadres f.code in ( 3, 4, 5); 

it unclear whether or not need select distinct. if don't, don't use unnecessarily in query.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -