Re: [SQL] select count of distinct rows

2005-12-10 Thread Havasvölgyi Ottó
Oh, that's it. Thank you all very much. Otto - Original Message - From: "Frank Bax" <[EMAIL PROTECTED]> To: Sent: Sunday, December 11, 2005 2:23 AM Subject: Re: [SQL] select count of distinct rows At 07:53 PM 12/10/05, Havasvölgyi Ottó wrote: I would like t

Re: [SQL] select count of distinct rows

2005-12-10 Thread Havasvölgyi Ottó
Yes, almost. I need the list of all different rows. It's syntax error at the *. ROW(*) ^ Otto - Original Message - From: "Jaime Casanova" <[EMAIL PROTECTED]> To: "Havasvölgyi Ottó" <[EMAIL PROTECTED]> Cc: Sent: Sunday, December 11, 2005 2:16 AM Subject: Re: select count of d

Re: [SQL] select count of distinct rows

2005-12-10 Thread Foster, Stephen
thing and should run faster. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jaime Casanova Sent: Saturday, December 10, 2005 7:13 PM To: Foster, Stephen Cc: Havasvölgyi Ottó; pgsql-sql@postgresql.org Subject: Re: [SQL] select count of distinct rows On 12

Re: [SQL] select count of distinct rows

2005-12-10 Thread Frank Bax
At 07:53 PM 12/10/05, Havasvölgyi Ottó wrote: I would like to select the count of distinct rows in a table. SELECT COUNT(DISTINCT *) FROM mytable; This does not work. How can I do it with Postgres? select count(*) from (select distinct * from mytable) as x; --

Re: [SQL] select count of distinct rows

2005-12-10 Thread Havasvölgyi Ottó
ROTECTED]> To: "'Havasvölgyi Ottó'" <[EMAIL PROTECTED]>; "'Jaime Casanova'" <[EMAIL PROTECTED]> Cc: Sent: Sunday, December 11, 2005 2:12 AM Subject: Re: [SQL] select count of distinct rows Well this should work but I tried it and it di

Re: [SQL] select count of distinct rows

2005-12-10 Thread Jaime Casanova
On 12/10/05, Havasvölgyi Ottó <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to select the count of distinct rows in a table. > > SELECT COUNT(DISTINCT *) FROM mytable; > > This does not work. How can I do it with Postgres? > > Thanks, > Otto > I guess what you need is to know how many times a

Re: [SQL] select count of distinct rows

2005-12-10 Thread Jaime Casanova
On 12/10/05, Foster, Stephen <[EMAIL PROTECTED]> wrote: > Well this should work but I tried it and it didn't. > > SELECT DISTINCT COUNT(*) FROM mytable; > No, it shouldn't work... actually is a non-sense, count will return just one value so there is nothing to be distinct with... -- regards, Jaim

Re: [SQL] select count of distinct rows

2005-12-10 Thread Foster, Stephen
bject: Re: [SQL] select count of distinct rows Hi, Yes, I need to compare all fields. Well, in this case it does not. Is this impossible? Thanks, Otto - Original Message - From: "Jaime Casanova" <[EMAIL PROTECTED]> To: "Havasvölgyi Ottó" <[EMAIL PROTECTE

Re: [SQL] select count of distinct rows

2005-12-10 Thread Havasvölgyi Ottó
:57 AM Subject: Re: [SQL] select count of distinct rows On 12/10/05, Havasvölgyi Ottó <[EMAIL PROTECTED]> wrote: Hi, I would like to select the count of distinct rows in a table. SELECT COUNT(DISTINCT *) FROM mytable; are really all the fields distincts? the table doesn't have

Re: [SQL] select count of distinct rows

2005-12-10 Thread Jaime Casanova
On 12/10/05, Havasvölgyi Ottó <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to select the count of distinct rows in a table. > > SELECT COUNT(DISTINCT *) FROM mytable; > are really all the fields distincts? the table doesn't have a pk? > This does not work. How can I do it with Postgres? > >

[SQL] select count of distinct rows

2005-12-10 Thread Havasvölgyi Ottó
Hi,   I would like to select the count of distinct rows in a table.   SELECT COUNT(DISTINCT *) FROM mytable;   This does not work. How can I do it with Postgres?   Thanks, Otto