- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- help in query
Operating System - HP-UX
1753275
Members
4808
Online
108792
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2008 09:37 PM
тАО03-09-2008 09:37 PM
help in query
can i get values in result set as weeknum alone from 1 to 53 using all_objects.
i wrote a query but it is returning only one week number. i will paste it over here.
but i want it to be done without using level and connect by....
select to_char(trunc(sysdate,'yyyy')+(rownum-1),'ww-yyyy') weeks
from all_objects
where rownum <=366
and to_char(trunc(sysdate,'yyyy')+rownum-1 ,'dd') = 1
Please rectify the mistake in the query... ASAP
i wrote a query but it is returning only one week number. i will paste it over here.
but i want it to be done without using level and connect by....
select to_char(trunc(sysdate,'yyyy')+(rownum-1),'ww-yyyy') weeks
from all_objects
where rownum <=366
and to_char(trunc(sysdate,'yyyy')+rownum-1 ,'dd') = 1
Please rectify the mistake in the query... ASAP
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2008 10:38 PM
тАО03-09-2008 10:38 PM
Re: help in query
hi Sailaja,
can you try the following:
yogeeraj@mydb.mu> r
1 select distinct to_char( dt+1, 'iw' )
2 from ( select trunc(sysdate,'YY')+rownum dt
3 from all_objects
4 where rownum < 366 )
5* order by 1
TO
__
01
02
03
04
05
06
07
08
...
49
50
51
52
52 rows selected.
Elapsed: 00:00:00.27
yogeeraj@mydb.mu>
hope this helps!
kind regards
yogeeraj
can you try the following:
yogeeraj@mydb.mu> r
1 select distinct to_char( dt+1, 'iw' )
2 from ( select trunc(sysdate,'YY')+rownum dt
3 from all_objects
4 where rownum < 366 )
5* order by 1
TO
__
01
02
03
04
05
06
07
08
...
49
50
51
52
52 rows selected.
Elapsed: 00:00:00.27
yogeeraj@mydb.mu>
hope this helps!
kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2008 10:53 PM
тАО03-09-2008 10:53 PM
Re: help in query
Thank You Yoogerag,
But can i get some thing without using "distinct".
But can i get some thing without using "distinct".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-09-2008 11:24 PM
тАО03-09-2008 11:24 PM
Re: help in query
hi,
Once 'dirty' way to achieve this is:
yogeeraj@mydb.mu> r
1 select to_char( dt+1, 'iw' )
2 from ( select trunc(sysdate,'YY')+rownum*7 dt
3 from all_objects
4 where rownum < 53 )
5* order by 1
TO
__
01
02
03
04
05
06
07
08
...
49
50
51
52
52 rows selected.
Elapsed: 00:00:00.12
yogeeraj@mydb.mu>
hope this helps!
kind regards
yogeeraj
Once 'dirty' way to achieve this is:
yogeeraj@mydb.mu> r
1 select to_char( dt+1, 'iw' )
2 from ( select trunc(sysdate,'YY')+rownum*7 dt
3 from all_objects
4 where rownum < 53 )
5* order by 1
TO
__
01
02
03
04
05
06
07
08
...
49
50
51
52
52 rows selected.
Elapsed: 00:00:00.12
yogeeraj@mydb.mu>
hope this helps!
kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP