mardi 30 août 2016

how to use INNER JOIN and IN Clause in same query

i have three tables and want to run INNER JOIN and IN clause on them. can anyone tell me where i am doing wrong

    SELECT `tblinvoices`.id,`tblinvoices`.userid,`firstname`,`lastname`
            FROM `tblinvoices`
WHERE `paymentmethod`IN 
(SELECT  `gateway` FROM  `tblpaymentgateways` WHERE  `setting`='type' AND `value` = 'CC') 
INNER JOIN `tblclients` ON `tblinvoices`.userid=`tblclients`.id"

Aucun commentaire:

Enregistrer un commentaire