[thelist] SQL: Problem with a join, i think

Casey Crookston caseyc at internetopus.com
Tue Feb 14 09:09:43 CST 2006


This query returns exactly what it should return when executing it in 
Enterprise Manager.  But when it's run off the .asp file, the results are 
weird:

SELECT     *
FROM         r2Sales_Customer INNER JOIN
                      c2Business_Type ON r2Sales_Customer.Customer_type = 
c2Business_Type.incremental_id AND
                      r2Sales_Customer.Name LIKE 'aaa' OR 
r2Sales_Customer.Address1 LIKE 'bbb' AND r2Sales_Customer.Zip LIKE '111'

c2Business _Type contains only eight rows, Prospect, internal referal, 
active customer, etc.  This query, when executed from the file, spits 8 
records -- one for each of the rows in  c2Business _Type.  Why would it 
return the correct results in EM but different when executed off a server???

Thanks!

Casey 




More information about the thelist mailing list