select Year from Int where Int.Year >= p_From and Int.Year <= p_To

select Year from Int where Int.Year >= p_From and Int.Year <= p_To

Post by Jenda Krynic » Thu, 02 Mar 2000 04:00:00



Is something like this possible?

For example I would like to get a recordset containing last ten
years. How?

The only way I found (no need to tell me that I'm stupid, I know
that) is :

 select Year(SYSDATE) from dual
 union
 select Year(SYSDATE)-1 from dual
 union
 ...

which is, well, next to unusable. Especialy if the range would
get bigger.

Thanks, Jenda
http://Jenda.McCann.cz (CC will be appreciated.)

 
 
 

select Year from Int where Int.Year >= p_From and Int.Year <= p_To

Post by xlR8 » Thu, 02 Mar 2000 04:00:00


Try "SELECT TOP 10 Year(SYSDATE) AS dtYear FROM dual ORDER BY Year
(SYSDATE)" - or something like that.
----



Quote:> Is something like this possible?

> For example I would like to get a recordset containing last ten
> years. How?

> The only way I found (no need to tell me that I'm stupid, I know
> that) is :

>  select Year(SYSDATE) from dual
>  union
>  select Year(SYSDATE)-1 from dual
>  union
>  ...

> which is, well, next to unusable. Especialy if the range would
> get bigger.

> Thanks, Jenda
> http://Jenda.McCann.cz (CC will be appreciated.)

--
++++++++++++++++++++++++++++++++++++++++
Check it:
O.o. H.N.N. o.O.: http://hackernews.com

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. pg_temp.<pid>.<int>


Tried that. I get "ERROR:  class "pg_temp.6004.0" is a system catalog". Is
it because it starts with "pg_"?

Thanks Tom.

Brian

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl

2. tastrade database

3. don't get the decimal value when dividing int by int

4. My SQL... Help

5. Converting Bytes(?) to Int / Int to Bytes

6. Dynamic web content?

7. getValueAt(int row, int column)

8. Ole' Support in record field

9. current fiscal year and last fiscal year by prompted month

10. date this year vs. last year

11. Difference from year to year

12. Way to create This Year, Last Year measures?

13. Year on year figures