By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 959 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Problem with SQL Query

P: 2
I am getting an error that my query is not properly ended Can someone tell me where I am going wrong with this.

Select ENG_ORD.ORD_CTL_NO, ENG_ORD.SER_NO, ENG_ORD.SHP_DT, ENG_ORD.SLS_MDL, ENG_ORD.ARR_NO, ENG_ORD.RTS_DT, ENG_ORD.DLR_CD
FROM ENG_ORD
WHERE (ENG_ORD.SHP_DT>='2012-01-26' AND ENG_ORD.SHP_DT< '2012-02-02') AND (ENG_ORD.DLR_CD LIKE '9GDM' OR ENG_ORD.DLR_CD LIKE 'B03%' OR ENG_ORD.DLR_CD LIKE 'Y157' OR ENG_ORD.DLR_CD LIKE 'Y186' OR ENG_ORD.DLR_CD LIKE 'Y302' OR ENG_ORD.DLR_CD LIKE 'Y941' OR ENG_ORD.DLR_CD LIKE 'Z105' OR ENG_ORD.DLR_CD LIKE 'Z107' OR ENG_ORD.DLR_CD LIKE 'Z319')
ORDER BY ENG_ORD.DLR_CD
union
SELECT PKG_ORD.ORD_CTL_NO, PKG_ORD.SER_NO, PKG_ORD.SHP_DT, PKG_ORD.SLS_MDL, PKG_ORD.ARR_NO, PKG_ORD.RTS_DT, PKG_ORD.DLR_CD
FROM PKG_ORD
WHERE (PKG_ORD.SHP_DT>= '2012-01-26' AND PKG_ORD.SHP_DT< '2012-02-02') AND (PKG_ORD.DLR_CD LIKE '9GDM' OR PKG_ORD.DLR_CD LIKE 'B03%' OR PKG_ORD.DLR_CD LIKE 'Y157' OR PKG_ORD.DLR_CD LIKE 'Y186' OR PKG_ORD.DLR_CD LIKE 'Y302' OR PKG_ORD.DLR_CD LIKE 'Y941' OR PKG_ORD.DLR_CD LIKE 'Z105' OR PKG_ORD.DLR_CD LIKE 'Z107' OR PKG_ORD.DLR_CD LIKE 'Z319')
ORDER BY PKG_ORD.DLR_CD
Feb 1 '12 #1
Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 10K+
P: 12,347
The query looks fine so MySQL must be expecting a semi-colon at the end of the query.
Feb 1 '12 #2

P: 3
im not clear it, but sure u should use one order by statement in that qry...
Feb 7 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.