Re: Can you use two COUNT(DISTINCT mycol) expressions in a SELECT list?
Posted in 1998
Peter Lancashire wrote:
>
> I tried this:
>
> select count(distinct prid), count(distinct trid)> # ^
> # 201: A syntax error has occurred.
> #
> from ats.trials
> where trial[1,2] = 'ER';
>
> Is this not allowed? I searched the manuals (and some info on SQL-92)
> and found nothing to disallow it. I know you can do MIN(mycol),
> MAX(mycol), AVG(mycol).
>
> Why do I want to do this? I thought it would be faster than two SELECT
> statements as the information comes from the same table.
>
> Am I missing something or is Informix missing something?
> --
I'm missing something. The manual says "You can use the DISTINCT keyword
once in each level of a query".
Sorry to bother you with my stupidity.
--
Peter Lancashire
Information Systems Specialist, Bayer plc
Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK
Tel: +44-1635-562258, Fax: +44-1635-562281
Mail: Peter.Lancashire.PL1@bayer.co.uk
---
My Internet plumbing does not allow me to mail and post news together.
Sorry.
All opinions are my own and not those of Bayer plc.
---
Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/