Subject | Re: [firebird-support] how to do a view (or work with) of top 80000 records |
---|---|
Author | Gary Benade |
Post date | 2005-06-22T21:55:27Z |
Alexander Gräf wrote,
select b.name, count(*) from customers c
join branches b on b.orderappend = c.branchcode and b.enabled = 'T'
where c.weighted_value >=
(SELECT FIRST 1 SKIP 80000 Weighted_Value FROM Customers
ORDER BY Weighted_Value DESC)
group by 1
thanks a million
Gary
> How about this:ended up with this, based on your example
>
> CREATE VIEW NEW_VIEW (
> NAME,
> WEIGHTED_VALUE)
> AS
> SELECT Name, Weighted_Value FROM Customers
> WHERE Weighted_Value >=
> (SELECT FIRST 1 SKIP 1 Weighted_Value FROM Customers
> ORDER BY Weighted_Value DESC);
select b.name, count(*) from customers c
join branches b on b.orderappend = c.branchcode and b.enabled = 'T'
where c.weighted_value >=
(SELECT FIRST 1 SKIP 80000 Weighted_Value FROM Customers
ORDER BY Weighted_Value DESC)
group by 1
thanks a million
Gary