Performance tune my sql query removing OR statements

Posted by SmartestVEGA on Stack Overflow See other posts from Stack Overflow or by SmartestVEGA
Published on 2010-04-21T08:36:32Z Indexed on 2010/04/21 8:43 UTC
Read the original article Hit count: 279

I need to performance tune following SQL query by removing "OR" statements

Please help ...

SELECT a.id, a.fileType, a.uploadTime, a.filename, a.userId, a.CID, ui.username, company.name  companyName, a.screenName
FROM TM_transactionLog  a, TM_userInfo  ui, TM_company  company, TM_airlineCompany  ac 
WHERE 
(           
  a.CID = 3049
)
OR       
( 
  a.CID = company.ID 
   AND 
  ac.SERVICECID = 3049 
   AND
  company.SPECIFICCID = ac.ID 
)
OR
(
  a.USERID = ui.ID
   AND
  ui.CID = 3049
);

© Stack Overflow or respective owner

Related posts about sql

Related posts about query