Connecting Tech Pros Worldwide Help | Site Map

Subquery convertion to run in mysql 4.0

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 28th, 2008, 08:41 AM
Newbie
 
Join Date: Aug 2008
Posts: 1
Default Subquery convertion to run in mysql 4.0

Hi

I have encounter problem in mysql with my query regarding subquery support. The IN and NOT IN are not supported.
my client's server is running the old version of mysql and he cant upgrade because of some reasons.

I read that you can convert this so it can run it in the old version

The query is below
Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT Document.DocID 
  2. FROM Document 
  3. Left Join T_ORDER 
  4. ON Document.DocID = T_ORDER.DocID 
  5. WHERE Document.Doc_Date>='08/28/2008' 
  6. AND Document.Doc_Date<='08/28/2008') 
  7. AND ( Document.From_ID 
  8. IN (SELECT Corp_Code.Code FROM Corp_Code WHERE Corp_Code.OrgID=48) OR Document.TO_ID 
  9. IN (SELECT Corp_Code.Code FROM Corp_Code WHERE Corp_Code.OrgID=48) )
  10.  AND Document.DocID 
  11. NOT IN ( SELECT T_ORDER.DocID FROM T_ORDER WHERE T_ORDER.CStatus='DONE' OR T_ORDER.CStatus IS NULL ))
  12.  
I am not really good in creating sql statements. If is not so much to ask can someone help me with this.
Thanks a lot.

yuan

Last edited by Atli; August 28th, 2008 at 09:22 PM. Reason: Added [code] tags.
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.