× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I use different field names and table name. But using this same statement
WITH PREFIX AS
(SELECT DISTINCT ITemnumber,SUBSTR(SiTeID,1,1) FROM pv)
SELECT itemnumber,COUNT(*) FROM PREFIX ORDER BY Itemnumber
Dies for me with a different error, which I fully expected since you're
doing a COUNT with no GROUP BY. Heck, even if that worked, how could it
be anything else but 1? The error I get is
Column ITEMNUMBER or expression in SELECT list not valid.
which is telling me that, since you have no group by, then all you should
get is one result for the grand total. And the grand total can't use a
column name on a summary function (like count).

If I change it to the following, with an appropriate group by, then it
works
WITH PREFIX AS
(SELECT DISTINCT ITemnumber,SUBSTR(SiTeID,1,1) FROM pv)
SELECT itemnumber,COUNT(*) FROM PREFIX
GROUP BY ITEMNUMBER
ORDER BY Itemnumber

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 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.