×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




That did the trick.

Thanks Elvis!

PETER VIDAL
MAPICS IT TECHNICAL SUPPORT TEAM / SR SYSTEM ANALYST
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
Tel:727-849-9999, x2414 Fax:727-815-3120
WWW.PALL.COM

"It is only with the heart that one can see rightly; what is essential is
invisible to the eye."
Antoine de Saint-Exupery




"Elvis Budimlic" <ebudimlic@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
01/22/2009 03:47 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
"'Midrange Systems Technical Discussion'" <midrange-l@xxxxxxxxxxxx>
cc

Subject
RE: SQL: How to get number of records (based on a prefix)






Your ORDER BY should read as GROUP BY instead.

Elvis

Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com


-----Original Message-----
Subject: Re: SQL: How to get number of records (based on a prefix)

I am doing:

WITH PREFIX AS
(SELECT DISTINCT ITNBR,SUBSTR(STID,1,1) FROM ITMRVA)
SELECT ITNBR,COUNT(*) FROM PREFIX ORDER BY ITNBR

... and it is giving me the error:
Token was not valid. Valid tokens: ( + * - ? : DAY RRN CASE CAST CHAR
DATE DAYS HASH HOUR LEFT TIME.

The cursor is placed between DISTINCT and ITNBR...

PETER VIDAL




This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.