[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

[sqr-users] DISTINCT problem



Hi all, I am having trouble running this query with a distinct keyword in
it.
 
BEGIN-SELECT 
distinct DECODE(OH.ORDTYP, 'XDCK', OH.SUMINV, OH.ORDNUM)    &tt

FROM STOP ST, ORDHDR OH
WHERE ST.STPTYP != 'POOL' AND
      ST.STPSEQ = OH.STPSEQ AND
      ST.SHIPID = OH.SHIPID AND
      OH.SHIPID = $shipid
ORDER BY OH.STPSEQ desc
END-SELECT
 
It gave me this error:
 
SQR V4.0.1
Copyright (C) SQRIBE Technologies, 1994-97.  All Worldwide Rights Reserved.
 
(SQR 5528) ORACLE ODESCR error -1791 in cursor 8:
   ORA-01791: not a SELECTed expression
(SQR 1303) Error in SQL (perhaps missing &name after expression):
select distinct DECODE(OH.ORDTYP, 'XDCK', OH.SUMINV, OH.ORDNUM)  FROM STOP
ST, ORDHDR OH WHERE ST.STPTYP != 'POOL' AND ST.STPSEQ = O
H.STPSEQ AND ST.SHIPID = OH.SHIPID AND OH.SHIPID = :1 ORDER BY OH.STPSEQ
desc 
(SQR 1304) Check SELECT columns, expressions and 'where' clause for syntax.
 
SQR: Program Aborting.

If I took out the distinct it ran without this error. Is there something I'm
missing?
Thanks
Nicholas

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users