How to use count distinct of expression lists
Posted in 2010
Topics: General Discussion
Does informix supports this :
select count(distinct col1||col2||col3) from tab
I tried this but gives synatx error :
select count(distinct tabid||tabname) from systables.
Any other way to achieve this..?
Thanks in advance.
pradeep
In newer versions try:
select count(distinct one )
from (select col1||col2||col3 as one from sometable);
Towit:
> select count(distinct one)
> from (select tabid||colno one from syscolumns);
(count)
734
1 row(s) retrieved.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
See you at the 2010 IIUG Informix Conference
April 25-28, 2010
Overland Park (Kansas City), KS
www.iiug.org/conf
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Tue, Apr 20, 2010 at 2:15 PM, PRADEEP KUMAR <pkyadav1@hotmail.com> wrote:
> Does informix supports this :
>
> select count(distinct col1||col2||col3) from tab>
> I tried this but gives synatx error :
>
> select count(distinct tabid||tabname) from systables.>
> Any other way to achieve this..?
>
> Thanks in advance.
>
> pradeep
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--001636e0a7d776faed0484af3c34
Thanks Art, It did the trick.