Re: Re: Howto: Count the number of groups returned by a Select
Posted in 2005
Ignacio...
Supongo que hablas espaqol:
En que estas programando? Si lo estas haciendo en Informix-4gl no tenis la necesidad de hacer un query como esos.
Si es en otro lenguaje la cosa cambia.
Tienes experiencia con Informix?
Te recomiendo que tengas a mano el manual:
Guide to SQL: Syntax (el pdf se llama: 25122840.pdf) si tienes el CD de la documentacisn de informix.
Online puedes conseguir informacisn via html en:
http://publib.boulder.ibm.com/infocenter/ids9help/index.jsp
Si tienes chance actualizate a la version 10. Esta trae un montsn de mejoras en todos los niveles, incluida las capacidades de SQL.
J.
-----Original Message-----
From: "Ignacio Mateos" <imateos@telefonica.net>
To: "Jean Sagi" <jeansagi@myrealbox.com>
Date: Tue, 6 Sep 2005 21:01:54 +0200
Subject: Re: Howto: Count the number of groups returned by a Select (Informix 9)
Thanks very much for your answer, solution 2 is the one that works for me
since I need to get this information from a program, not just interactively.
How can I find about this multiset option, is this a collection or
something?
Thank you!
----- Original Message -----
From: "Jean Sagi" <jeansagi@myrealbox.com>
To: <imateos@telefonica.net>
Cc: <informix-list@iiug.org>
Sent: Tuesday, September 06, 2005 7:42 PM
Subject: Re: Howto: Count the number of groups returned by a Select
(Informix 9)
While in dbaccess :
type your query
select * from my_table group by a, b;
then in the menus choose:
_Output_ then _New file_ then wirite any name, x for example and enter.
Then the number of rows returned appear onscreen.
It happen to be very fast:
Once the query is typed do these combination of keys:
ESC - O - N - x - ENTER
It might seem ugly, but it's fast... but guess waht you're in 9.x son you
could do:
select count(*)
from table( multiset(
select a,b from my_table group by a, b
) );
J.
-----Original Message-----
From: "ignacio mateos" <imateos@telefonica.net>
To: informix-list@iiug.org
Date: 6 Sep 2005 06:30:23 -0700
Subject: Howto: Count the number of groups returned by a Select (Informix 9)
Hi I am trying
select count ( distinct a|| b) from my_table;
but it turns out that count( distinct ) does not work on expressions.
(What I need is to know how many records the
select * from my_table group by a, b;
would return)
Is there a simple way to do this without using temp tables?
THANKS
Jean Sagi
jeansagi@myrealbox.com
jeansagi@gmail.com
Jean Sagi
jeansagi@myrealbox.com
jeansagi@gmail.com
sending to informix-list