surabhi sinha wrote:

Ihave the following subquery which i intend to use for mysql4.0.12
can u tell me how it could be formed for use since no common column
is there for it to be converted to Inner join

What about Companyid?


Select CompanyName,City from Company where
CompanyName='Arihant Jain' and City='Delhi'
and companyid in (Select Companyid from Opport where Userid=1
and Opportunityfor=0 Union Select Companyid from Lead where Userid=1
and Qualifyflag=1 union Select companyid from lead where userid=1
and qualifyflag=2 union Select companyid from accountsorder where userid=1);

How about:


Select CompanyName,City from Company c INNER JOIN Opport o ON
c.Companyid = o.Companyid
 where CompanyName='Arihant Jain' and City='Delhi'  AND Userid = 1 AND
Opportunityfor = 0
UNION
Select CompanyName,City from Company c INNER JOIN Lead l ON c.Companyid
= l.Companyid
 where CompanyName='Arihant Jain' and City='Delhi'  AND Userid = 1 AND
Qualifyflag IN (1, 2)
UNION
Select CompanyName,City from Company c INNER JOIN accountsorder a ON
c.Companyid = a.Companyid
 where CompanyName='Arihant Jain' and City='Delhi'  AND Userid = 1

Bruce Feist




-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to