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
-
SELECT DISTINCT Document.DocID
-
FROM Document
-
Left Join T_ORDER
-
ON Document.DocID = T_ORDER.DocID
-
WHERE Document.Doc_Date>='08/28/2008'
-
AND Document.Doc_Date<='08/28/2008')
-
AND ( Document.From_ID
-
IN (SELECT Corp_Code.Code FROM Corp_Code WHERE Corp_Code.OrgID=48) OR Document.TO_ID
-
IN (SELECT Corp_Code.Code FROM Corp_Code WHERE Corp_Code.OrgID=48) )
-
AND Document.DocID
-
NOT IN ( SELECT T_ORDER.DocID FROM T_ORDER WHERE T_ORDER.CStatus='DONE' OR T_ORDER.CStatus IS NULL ))
-
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