Re: Query

From: "Laconic2" <laconic2(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Query
Date: 2004-06-16 20:35:41
Message-ID: 84GdnbDDS-xeM03dRVn-tw@comcast.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


"Michael" <dayzman(at)hotmail(dot)com> wrote in message
news:48e30213(dot)0406152231(dot)6e19331c(at)posting(dot)google(dot)com(dot)(dot)(dot)
> Hi,
> If I have R(a integer PRIMARY KEY, b text, c text, d integer); and I
> want to find how many different entries there are, (specified using b
> and c instead of a), is "select count(distinct b||c) from R" an
> appropriate query?

Try:

select count(1) from
(select distinct b, c from R);

However, your prof may not like this answer.

In response to

  • Query at 2004-06-16 06:31:42 from Michael

Browse pgsql-general by date

  From Date Subject
Next Message Joolz 2004-06-16 20:43:53 Re: reference to a view
Previous Message Robert Fitzpatrick 2004-06-16 20:27:13 Database accesss using plperl