Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old August 28th, 2008, 09: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 10:22 PM. Reason: Added [code] tags.
Reply
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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 network members.
Post your question now . . .
It's fast and it's free

Popular Articles