Zdravko Balorda wrote:
> this is probably an old issue but I'm not all that experienced.
>
> I wonder if an index can be accessed rather directly, as to speed up
> a query like "select count(distinct())", by simply calculating the
> number of branches (leaves) an index has. Or at least to skip sor
Hi,
this is probably an old issue but I'm not all that experienced.
I wonder if an index can be accessed rather directly, as to speed up
a query like "select count(distinct())", by simply calculating the
number of branches (leaves) an index has. Or at least to skip sorting.
Best regards, Zdr
Stephan,
> Would that be the same as:
> select count(distinct skip_date) from weekend_list
> where ...
Yeah, that would be what I was looking for.
--
-Josh Berkus
Aglio Database Solutions
San Francisco
---(end of broadcast)---
TIP 4: Don't '
On Tue, 30 Jul 2002, Josh Berkus wrote:
> Folks,
>
> Anybody know a keen shortcut for the following:
>
> SELECT count(skip_date)
> FROM (SELECT DISTINCT skip_date FROM weekend_list
> WHERE ... ...) days_to_skip;
>
> That's a double aggregate, and is bound to be dog-slow.
Would tha
Anthony <[EMAIL PROTECTED]> writes:
> I think it's time to get Mr. Sysadmin to upgrade to v7 ;)
That's a good idea on many grounds, not only this one ;-)
However, if you really need a 6.5.* solution, you could do
SELECT DISTINCT foo INTO TEMP TABLE mytemp FROM ...
SELECT COUNT(*
Kenn Thompson wrote:
> Ok- messy, but it works
>
> CREATE VIEW testview AS
> select distinct area from areapostcode where postcode like 'BS1%';
>
> SELECT COUNT(*) FROM testview;
>
> kenn
>
> >>> Anthony <[EMAIL PROTECTED]> 11/27/00 01:07PM >>>
> Kenn Thompson wrote:
>
> > What about
> >
> >
Najm Hashmi wrote:
> Anthony wrote:
>
> > Michael Fork wrote:
> >
> > > I think you want
> > >
> > > SELECT count(distinct(area)) FROM areapostcode WHERE postcode LIKE 'BS1%'
> > >
> >
> > psql still not happy :(
> >
> > SELECT count(distinct(area)) FROM areapostcode WHERE postcode LIKE 'BS1%';
>
Tom Lane wrote:
> Anthony <[EMAIL PROTECTED]> writes:
> > select count( distinct area ) from areapostcode where postcode like
> > 'BS1%'
> > the above statement fails with
> > ERROR: parser: parse error at or near "distinct"
>
> What Postgres version are you running? Support for count(d
Anthony <[EMAIL PROTECTED]> writes:
> select count( distinct area ) from areapostcode where postcode like
> 'BS1%'
> the above statement fails with
> ERROR: parser: parse error at or near "distinct"
What Postgres version are you running? Support for count(distinct foo)
was added in 7.0,
Kenn Thompson wrote:
> What about
>
> select count(*) from (select distinct area from areapostcode where postcode like
>'BS1%')
>
select count(*) from (select distinct area from areapostcode where
postcode like 'BS1%');
ERROR: parser: parse error at or near "select"
Thanks, any more ideas?
>
Michael Fork wrote:
> I think you want
>
> SELECT count(distinct(area)) FROM areapostcode WHERE postcode LIKE 'BS1%'
>
psql still not happy :(
SELECT count(distinct(area)) FROM areapostcode WHERE postcode LIKE 'BS1%';
ERROR: parser: parse error at or near "distinct"
Thanks,
Bap.
>
> Michael
I think you want
SELECT count(distinct(area)) FROM areapostcode WHERE postcode LIKE 'BS1%'
Michael Fork - CCNA - MCP - A+
Network Support - Toledo Internet Access - Toledo Ohio
On Mon, 27 Nov 2000, Anthony wrote:
> Apologies if this has been asked b4, but got this result when
> attemplting to
Jose Rodrigo Fernandez Menegazzo wrote:
> > The problem I have is with this statement:
> >
> > select count( distinct area ) from areapostcode where postcode like
> > 'BS1%'
> >
> > the above statement fails with
> > ERROR: parser: parse error at or near "distinct"
> >
> > I am not the g
> The problem I have is with this statement:
>
> select count( distinct area ) from areapostcode where postcode like
> 'BS1%'
>
> the above statement fails with
> ERROR: parser: parse error at or near "distinct"
>
> I am not the greatest when it comes to SQL, but the pgsql docs implied
>
Apologies if this has been asked b4, but got this result when
attemplting to search the archives on the website
Not Found
The requested URL /mhonarc/pgsql-sql/search.cgi was not found on this
server.
Apache/1.3.12 Server at postgresql.rmplc.co.uk Port 80
The problem I have is with this statem
15 matches
Mail list logo