Query to get MIN hour
Hello to all.
How I can get row having MIN hour(DESPITE DAY) ( for the first six hour 08:00 to 14:00 , AND NEXT 6 hour 14:01 to 20:00 )
if this following is my sample
03/05/2012 17:30:00
04/05/2012 17:00:00
10/05/2012 18:00:00
12/05/2012 08:00:00
10/05/2012 07:00:00
03/05/2012 11:00:00 my result should be 07:00:00 first six hours, and 17:00:00 next six)
Thanks in advance for any help
It looks like you're talking about 6 hours blocks in the day, offset by 2 hours from midnight, so this should give you some idea of what you could do...
SQL> ed
Wrote file afiedt.buf
1 with t as (select to_date('03/05/2012 17:30:00','DD/MM/YYYY HH24:MI:SS') as dt from dual union all
2 select to_date('04/05/2012 17:00:00','DD/MM/YYYY HH24:MI:SS') from dual union all
3 select to_date('10/05/2012 18:00:00','DD/MM/YYYY HH24:MI:SS') from dual union all
4 select to_date('12/05/2012 08:00:00','DD/MM/YYYY HH24:MI:SS') from dual union all
5 select to_date('10/05/2012 07:00:00','DD/MM/YYYY HH24:MI:SS') from dual union all
6 select to_date('03/05/2012 11:00:00','DD/MM/YYYY HH24:MI:SS') from dual
7 )
8 --
9 -- end of example data
10 --
11 select case dt_part
12 when 1 then '02:00:00 to 07:59:59'
13 when 2 then '08:00:00 to 13:59:59'
14 when 3 then '14:00:00 to 19:59:59'
15 when 4 then '20:00:00 to 01:59:59'
16 else null end as tm_part
17 ,to_char(min(to_date(to_char(dt,'HH24:MI:SS'),'HH24:MI:SS')),'HH24:MI:SS') as min_tm
18 from (
19 select dt
20 ,case when offset_dt between to_date('00','HH24') and to_date('05:59:59','HH24:MI:SS') then 1
21 when offset_dt between to_date('06','HH24') and to_date('11:59:59','HH24:MI:SS') then 2
22 when offset_dt between to_date('12','HH24') and to_date('17:59:59','HH24:MI:SS') then 3
23 when offset_dt between to_date('18','HH24') and to_date('23:59:59','HH24:MI:SS') then 4
24 else null end as dt_part
25 from (
26 select dt, to_date(to_char(dt-(2/24),'HH24:MI:SS'),'HH24:MI:SS') offset_dt
27 from t
28 )
29 )
30 group by dt_part
31* order by dt_part
SQL> /
TM_PART MIN_TM
02:00:00 to 07:59:59 07:00:00
08:00:00 to 13:59:59 08:00:00
14:00:00 to 19:59:59 17:00:00The conversions between date and char take place to remove the date component and thus normalise all the times to be on the same day.
Edited by: BluShadow on 16-Nov-2012 15:10
Note, in the above solution the times that fall between 20:00:00 and 01:59:59 will treat the times from 00:00:00 to 01:59:59 as being before 20:00:00 so such times will come out as the minimum. If it's the ealiest time in that block of 6 hours you want, then a little more coding is required to get the minimum based on the offset time. But I'm not going to code that, as it's still not exactly clear what the issue is that is trying to be solved.
Similar Messages
-
Query to get all minutes in last one hour
Dear All,
I am trying to write a query that returns every minute in last one hour.
Like now, if the time is 4:15
The query returns;
3:14
3:15
4:11
4:12
4:13
4:14
4:15
Please suggest a logic.
Thank you so much.
Regards, ImranYou can also add or subtract INTERVAL literals to or from a DATE, for example:
SYSDATE - INTERVAL '5' MINUTE
The result is a DATE.
Frank @ Getting the hour,seconds and minutes of a date data
Regrads
Girish Sharma -
SQL query to get the Datetime 06 hours prior to the table Datetime value
Hi Experts,
I'm just trying to create a SQL query to get the Datetime which should be 06 hours prior to my Table column value(Executiontime),
Eg: my Executiontime(column) value is 07:00AM means, this query should fetch the detail of first VMName from table at 01:00AM,
SQL Table Name: TestTable
Columns: VMName(varchar),status(varchar) Executiontime(Datetime)
SQL Query : Select Top 1 VMName from
TestTable where convert(date,Exeutiontime)=convert(date,getdate()) and
status='0' and ExecutionTime > dateadd(hour,6,getdate())
Request someone to alter this Query to my requirement or give me the new one.
Regards,
Sundar
SundarHi All,
Thanks for your Prompt response. I tried the below queries, but still I don't have any luck. Actually the queries are returning the value before the condition met (say when the time difference is more than 06 hours). I want the
query to return exactly @ 06 hour difference or less than 06 hours,
Query 01: Select Top 1 VMName from TestTable where
convert(date,Exeutiontime)=convert(date,getdate())
and status='0'
and ExecutionTime >
dateadd(hour,-6,getdate())
Query 02: Select
Top 1 VMName from TestTable where
status='0'
and ExecutionTime >
dateadd(hour,-6,getdate())
Query 03: Select
Top 1 VMName from TestTable where status='0'
and ExecutionTime >
dateadd(hour,-6,ExecutionTime)
Can someone point out the mistake please.
Regards,
Sundar
Sundar -
How to get min,max,avg time for query execution?
Dear Friends,
In AWR we are getting avg time taken to execute particular query, how can one get min,max time taken by query during number of executions.
ThanksI would run the sql in a cursor for loop, to get a quite reasonable execution time without changing the actual execution plan:
SQL> show user;
USER is "HR"
SQL> set timing on
SQL> select count(*) from all_objects;
COUNT(*)
55565
Elapsed: 00:00:03.91
SQL> var p_sql varchar2(200)
SQL> exec :p_sql := 'select * from all_objects'
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:03.53
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.75
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.73
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.66
SQL> ---- alter system flush shared_pool;
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.80
SQL> declare
2 t1 timestamp := systimestamp;
3 begin
4 execute immediate 'begin for c in (' || :p_sql || ') loop null; end loop; end;';
5 dbms_output.put_line('Elapsed: ' || (systimestamp - t1));
6 end;
7 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.64
SQL>
https://forums.oracle.com/thread/705536?start=15&tstart=0
Regards
Girish Sharma -
Query help : Query to get values SYSDATE-1 18:00 hrs to SYSDATE 08:00 hrs
Hi Team
I want the SQl query to get the data for the following comparison : -
Order Created is a Date Column , and i want to find out all the values from (SYSDATE-1) 18:00 hours to SYSDATE 08:00 hours
i.e.
(SYSDATE-1) 18:00:00 < Order.Created < SYSDATE 08:00:00.
RegardsHi, Rohit,
942281 wrote:
If i want the data in the below way i.e.
from (SYSDATE-1) 18:00 hours to SYSDATE 17:59 hours ---> (SYSDATE-1) 18:00:00 < Order.Created < SYSDATE 07:59:00.If you want to include rows from exactly 18:00:00 yesterday (but no earlier), and exclude rows from exatly 08:00:00 today (or later), then use:
WHERE ord_dtl.submit_dt >= TRUNC (SYSDATE) - (6 / 24)
AND ord_dtl.submit_dt < TRUNC (SYSDATE) + (8 / 24)
So can i use the below format : -
ord_dtl.submit_dt BETWEEN trunc(sysdate)-(6/24) and trunc(sysdate)+(7.59/24) . Please suggest . .59 hours is .59 * 60 * 60 = 2124 seconds (or .59 * 60 = 35.4 minutes), so the last time included in the range above is 07:35:24, not 07:59:59.
If you really, really want to use BETWEEN (which includes both end points), then you could do it with date arithmentic:
WHERE ord_dtl.submit_dt BETWEEN TRUNC (SYSDATE) - (6 / 24)
AND TRUNC (SYSDATE) + (8 / 24)
- (1 / (24 * 60 * 60))but it would be simpler and less error prone to use INTERVALs, as Karthick suggested earlier:
WHERE ord_dtl.submit_dt BETWEEN TRUNC (SYSDATE) - INTERVAL '6' HOUR
AND TRUNC (SYSDATE) + INTERVAL '8' HOUR
- INTERVAL '1' SECONDEdited by: Frank Kulash on Apr 17, 2013 9:36 AM
Edited by: Frank Kulash on Apr 17, 2013 11:56 AM
Changed "- (8 /24)" to "+ (8 /24)" in first code fragment (after Blushadown, below) -
Query to get the blocker and holder info
Hi All,
I have framed the following query to get the blocker and holder info.I intend to use this query in a auto-generated mail which executes every 15 mins
I have put an outer join on the holder because the holder query might have been executed at the time the auto mail configuration fires this query
I am not a dba and was apprehensive is there is some mistake in the logic of my query. I was also expecting to join v$sql_bind_capture using sql_hash_value and sql_address just the way in which I have joined v$sqlarea
Looking forward to your kind help in vetting the below query
Select distinct waiting_session,
dba_waiters.holding_session,
decode(to_char(session_waiting_info.STATE),'0','waiter is currently waiting','-2','duration of last wait by waiter is unknown','-1','waiter waited for a short time',' waiter waited long time') "waiters waiting state",
decode(session_waiting_info.WAIT_TIME,0,'waiter waiting') "waiters last wait time",
decode(to_char(session_holding_info.STATE),'0','holder is currently waiting','-2','duration of last wait by holder is unknown','-1','holder waited for a short time','holder waited long time') "holders waiting state",
decode(session_holding_info.WAIT_TIME,0,'waiter waiting') "holders last wait time",
sql_waiting_info.sql_text "query of the waiter",
sql_holding_info.sql_text "query of the holder",
session_waiting_info.STATUS "waiting STATUS",
session_holding_info.STATUS "holding STATUS",
session_waiting_info.process "waiting process",
session_waiting_info.PROGRAM "waiting PROGRAM",
session_holding_info.process "holding process",
session_holding_info.PROGRAM "holding PROGRAM",
session_waiting_info.ROW_WAIT_OBJ# "waiting object",
session_waiting_info.ROW_WAIT_ROW# "waiting row",
session_holding_info.ROW_WAIT_OBJ# "holding object",
session_holding_info.ROW_WAIT_ROW# "holding row",
session_waiting_info.BLOCKING_SESSION_STATUS "waiting session status",
session_holding_info.BLOCKING_SESSION_STATUS "holding session status",
session_waiting_info.username "holding os username",
session_holding_info.username "waiting os username",
session_waiting_info.MACHINE "waiting MACHINE",
session_waiting_info.TERMINAL "waiting TERMINAL",
session_holding_info.MACHINE "holding MACHINE",
session_holding_info.TERMINAL "holding TERMINAL",
session_waiting_info.TYPE "waiting TYPE",
session_holding_info.TYPE "holding TYPE"
from dba_waiters,
v$session session_holding_info,
v$session session_waiting_info,
v$sqlarea sql_waiting_info,
v$sqlarea sql_holding_info
Where dba_waiters.waiting_Session = session_waiting_info.sid
and dba_waiters.holding_Session = session_holding_info.sid
And session_waiting_info.sql_hash_value = sql_waiting_info.hash_value
And session_waiting_info.sql_address = sql_waiting_info.address
and session_holding_info.sql_hash_value = sql_holding_info.hash_value(+)
And session_holding_info.sql_address = sql_holding_info.address(+)
and dba_waiters.mode_held <> 'None'
Regards,
Vishal
Edited by: user11924113 on Feb 18, 2011 2:39 AMQuery to track the holder and waiter info
People who reach this place for a similar problem can use the above link to find their answer
Regards,
Vishal -
Wrong query is getting generated in WHERE NOT EXISTS with group by clause
Query is getting generated wrongly in where not exists section when i use group by function.Please prvoide me any clue to over come the problem.
/* DETECTION_STRATEGY = NOT_EXISTS */
INSERT /*+ APPEND */ INTO STG_ETL.I$_DCMT_TIMEZONE_LOOKUP
TZ_OFFSET,
ADT_CRT_DT,
ADT_UPDT_DT,
IND_UPDATE
SELECT * FROM (
SELECT
to_number(KOFAX.RECEIVED_TZ) TZ_OFFSET,
min(sysdate) ADT_CRT_DT,
min(sysdate) ADT_UPDT_DT,
'I' IND_UPDATE
FROM ESTG.FLAT_FIL_DMS_KOFAX KOFAX
WHERE (1=1)
And (KOFAX.LD_DT = ( select MAX(LD_DT) from ESTG.FLAT_FIL_DMS_KOFAX INNER
where INNER.ENGAGEMENT=KOFAX.ENGAGEMENT
and INNER.KOFAX_FILE_NM = KOFAX.KOFAX_FILE_NM
AND INNER.IM_CUST_ID = KOFAX.IM_CUST_ID
and INNER.BATCH_ID=KOFAX.BATCH_ID)
AND
(TO_DATE(KOFAX.LD_DT)>=TO_DATE(SUBSTR('#WAREHOUSE.P_EDW_LAST_RUN',1,10),'YYYY-MM-DD'))
And (substr(KOFAX.RECEIVED_TZ,1,1) <> '+')
Group By to_number(KOFAX.RECEIVED_TZ)
) S
WHERE NOT EXISTS (
SELECT 'X'
FROM EDW.DCMT_TIMEZONE_LOOKUP T
WHERE T.TZ_OFFSET = S.TZ_OFFSET AND
)Easiest fix for you would be to change the detection_strategy on the IKM from NOT_EXISTS to either :
MINUS
-- Try this out, it should work, it will give the same data through the equiverlant steps.
NONE
-- This will load all incoming data into your I$ table, there will be more rows to crunch in the following 'Flag Rows for Update' step, it might give incorrect results potentially - you will have to test it.
So try MINUS first, failing that, see if NONE gives you what you want in your target.
Are you inserting only new data or updating existing data? -
Needs Query to get the cycle time automatically based on the value provided in the UDF on OWOR table
Dear all,
Need a query to get the Cycle time in hr based on the value provide in the udf on OWOR table.
Details of UDF:-
1.Start date =10/07/14 (Field Name U_EA_REST)
2.Start time =10:00 (Field Name U_EA_REASTARTTIME)
3.End date =11/07/14 (Field Name U_EA_REET)
4.End Time=14:00 (Field Name U_EA_REAENDTIME
Cycle Time=_______ (Field Name U_EA_REACYCLETIME)
Regards,
BanugopanRajendranDear all,
Need a query to get the Cycle time in hr based on the value provide in the udf on OWOR table.
Details of UDF:-
1.Start date =10/07/14 (Field Name U_EA_REST) - Date Type
2.Start time =10:00 (Field Name U_EA_REASTARTTIME) - Hour Type
3.End date =11/07/14 (Field Name U_EA_REET) - Date Type
4.End Time=14:00 (Field Name U_EA_REAENDTIME - Hour Type
Cycle Time=_______ (Field Name U_EA_REACYCLETIME) - Hour Type
Regards,
BanugopanRajendran -
Thanks in advance for help
I have a query as below
SELECT FI.TCOL1 ,FI.TIPO,FI.TCOL2,COUNT(*) NUM,
SUM(FI.TCOL3) SUM_IPBFA,SUM(FI.TCOL4), MIN(FI.COL5) DA_NUM,MAX(FI.COL6) A_NUM
FROM DBTABLE FI
WHERE TDATA between DATABEG and DATAEND
GROUP BY FI.TCOL1 ,TIPO_A,TCOL2
ORDER BY 1,3 How get MIN e MAX grouped only for FI.TCOL1?
e.g
SELECT FI.TCOL1, MIN(FI.COL5) DA_NUM,MAX(FI.COL6) A_NUM
FROM DBTABLE FI
WHERE TDATA between DATABEG and DATAEND
GROUP BY FI.TCOL1 ,TIPO_A,TCOL2
ORDER BY 1,3Thanksit will be better if you can post some sample data and output to work on and to get a better understanding of your requirements.
you might want to try this but not sure if this will give you the result you needed:
Select f1.tcol1,
f1.da_num,
f2.a_num
From (SELECT FI.TCOL1,
MIN(FI.COL5) DA_NUM
FROM DBTABLE FI
WHERE FI.TDATA between DATABEG and DATAEND
GROUP BY FI.TCOL1) F1,
(SELECT FI.TCOL1,
MAX(FI.COL6) A_NUM
FROM DBTABLE FI
WHERE FI.TDATA between DATABEG and DATAEND
GROUP BY FI.TCOL1) F2
Where f1.tcol1 = f2.tcol2
Order by 1,2,3 -
Help to write query to get records from specified time TO specified time?
I have a table which has large data and the table is updated every min,
Suppose the Table comp(timeid date,sessions varchar2,sid varchar2)
Here time needs to be checked
So now i have to write a query which displays records that have been in the table
for every 5 mins
default timeframe is sysdate-5 then the lower and upper bound is multiple of 5 i.e
Suppose now Time and sysdate: 12-sep-2007 1:22:00pm
From sysdate: 12-sep-2007 1:15:01pm TO sysdate: 12-sep-2007 1:20:00pm
So i need a query to get the records from 1:15:01pm to 1:20pm.
Message was edited by:
user594721Explanation is not clear.Please give sample data and expected o/p.
If you need the data of previous five minutes, do like this...
SQL> select id, to_char(time,'dd/mm/yyyy hh:mi:ss') time
2 from test;
ID TIME
1 13/09/2007 10:29:55
1 13/09/2007 10:29:22
1 13/09/2007 10:20:28
SQL> select id, to_char(time,'dd/mm/yyyy hh:mi:ss') time,
2 to_char(sysdate,'dd/mm/yyyy hh:mi:ss') current_time
3 from test
4 where time between (sysdate - (5/24/60)) and sysdate;
ID TIME CURRENT_TIME
1 13/09/2007 10:29:55 13/09/2007 10:32:45
1 13/09/2007 10:29:22 13/09/2007 10:32:45 -
Need to create report query to get latest open and last closed period for given application
Hi All,
I need to create a report query to get below result displayed in report output.
1) - Application name
2) - Ledger name
-o/ -Operating Unit
3) - Last Closed Period
4) - Current Open Period
5) - Date Closed – Last Closed Period
6) - Date Open – Current Open Period
I tr I tried to create the query below is the same. Please let me know if it looks fine.
SELECT *
FROM (SELECT fav.application_name ,
hou.name Operating_Unit_Name,
gl.name Ledger_name,
gl.latest_opened_period_name,
gps.period_name Period_Name,
DECODE(gps.closing_status, 'O', 'Open', 'C', 'Closed') status,
gps.last_update_date Last_status_modified_date
FROM gl_period_statuses gps,
gl_sets_of_books gsob,
fnd_application_vl fav,
hr_operating_units hou,
gl_ledgers gl
WHERE gps.period_name = gps.period_name
AND gps.closing_status ='C'
AND fav.application_short_name =
NVL('&p_application_short_name', fav.application_short_name)
AND gps.application_id = fav.application_id
AND gsob.set_of_books_id = gps.set_of_books_id
AND hou.set_of_books_id = gps.set_of_books_id
AND gl.ledger_id = gsob.set_of_books_id
AND hou.organization_id=NVL('&p_operating_unit',hou.organization_id)
AND gl.ledger_id=NVL('&p_ledger_id',gl.ledger_id)
ORDER BY gps.last_update_date desc )WHERE ROWNUM = 1
UNION ALL
SELECT *
FROM (SELECT fav.application_name Application_Name,
hou.name Operating_Unit_Name,
gl.name Ledger_name,
gl.latest_opened_period_name,
gps.period_name Period_Name,
DECODE(gps.closing_status, 'O', 'Open', 'C', 'Closed') status,
gps.last_update_date Last_status_modified_date
FROM gl_period_statuses gps,
gl_sets_of_books gsob,
fnd_application_vl fav,
hr_operating_units hou,
gl_ledgers gl
WHERE gps.period_name = gps.period_name
AND gps.closing_status = 'O'
AND fav.application_short_name =
NVL('&p_application_short_name', fav.application_short_name)
AND gps.application_id = fav.application_id
AND gsob.set_of_books_id = gps.set_of_books_id
AND hou.set_of_books_id = gps.set_of_books_id
AND gl.ledger_id = gsob.set_of_books_id
AND hou.organization_id=NVL('&p_operating_unit',hou.organization_id)
AND gl.ledger_id=NVL('&p_ledger_id',gl.ledger_id)
ORDER BY gps.last_update_date desc)
WHERE ROWNUM = 1It is within the table I believe (I'm not a DBA or a developer) since I created a BLOB column and then used the file browse feature to allow users to attach a resume to the table in order to be able to perform a search of the attached documents.
I'm just having a hard time pointing the link in the search results report to the document in the blob column.
The information on that page is great if you're trying to create a link to the document on the initial report.
But I created a query using Oracle Text to run a report that does a boolean search of the attached word documents in the table.
When it displays the search results, it doesn't create a link to the document and I can't figure out how to do it.
Here's a link the the instructions I used to create the initial search report with Oracle Text, mind you I only created the index and query, I didn't add in all the link data since they're using documents on websites and I'm using documents in a table.
http://www.oracle.com/technology/products/database/application_express/pdf/apex_text_application_v1.6.pdf
If you can help me with this I'd really appreciate it.
Thanks again.
Greg
Edited by: gjones77 on Dec 2, 2008 8:14 AM -
My wife and i share the same computer to sync our phones with. The last time i sync i lost all my phone numbers and got hers. Is there a way to get mine back. Please Help. Thanks
Have a read here...
https://discussions.apple.com/message/18409815?ac_cid=ha
And See Here... http://support.apple.com/kb/HT1495
Create a New User Account for each User.
Then Each user will have their own iTunes library..
More Info Here > cnettv.cnet.com/use-two-iphones-one-computerl -
I have the new iOS 7 and am getting texts from another family members phone and they are getting mine how do I disable this without changing accounts
Welcome to the Apple Community.
You could simply set each device to only use a single telephone number (settings > messages > send & receive, but this isn't really an ideal solution since the other person can always change their settings and see your messages and send messages that appear as if they are from you. There is only one real solution and that's to have your own accounts. -
I have the new iOS 7 and am getting texts from another family members phone and they are getting mine how to I disable this ??
You each need to have separate Apple IDs and separate user accounts. Better yet, separate computers as well.
-
Query to get the data of all the columns in a table except any one column
Can anyone please tell how to write a query to get the data of all the columns in a table except one particular column..
For Example:
Let us consider the EMP table.,
From this table except the column comm all the remaining columns of the table should be listed
For this we can write a query like this..
Select empno, ename, job, mgr, sal, hiredate, deptno from emp;
Just to avoid only one column, I mentioned all the remaining ( 7 ) columns of the table in the query..
As the EMP table consists only 8 columns, it doesn't seem much difficult to mention all the columns in the query,
but if a table have 100 columns in the table, then do we have to mention all the columns in the query..?
Is there any other way of writing the query to get the required result..?
Thanks..Your best best it to just list all the columns. Any other method will just cause more headaches and complicated code.
If you really need to list all the columns for a table because you don't want to type them, just use something like...
SQL> ed
Wrote file afiedt.buf
1 select trim(',' from sys_connect_by_path(column_name,',')) as columns
2 from (select column_name, row_number() over (order by column_id) as column_id
3 from user_tab_cols
4 where column_name not in ('COMM')
5 and table_name = 'EMP'
6 )
7 where connect_by_isleaf = 1
8 connect by column_id = prior column_id + 1
9* start with column_id = 1
SQL> /
COLUMNS
EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO
SQL>
Maybe you are looking for
-
I want to upgrade my iOS 4 to 5 on my Ipod Touch but I no longer have the original computer I used to sync with so it keeps saying I will loose all of my apps and stuff on my new computer..... SO how do I tell it that my new computer is now my regula
-
SCORE: Tuplets, can't get 15:16 tuplet to work
Hi Rohan and you other score guru types, No matter what I do I can't these notes to display as a single 15-tuplet of 32nd notes. But as seen in the pic, I'm able to group them as three groups of quintuplets (but this isn't what I want). Is there some
-
DB refresh btwn systems running on different OS versions
Our SAP BW 3.5 is running on - Development Environment - (MS SQL server 64-bit; virtualised) - Production Environment - (MS SQL server 32-bit) Is it possible to do DB refresh of Development systen from Production with the above-mentione
-
Smooth scrolling using a magic mouse
Hi all, I've recently made the switch to Mac (sporting a MacBook Pro 15" retina early 2013) from Windows. I'm still using Windows through Parallels since I need to use Visual Studio for my work as a developer. Currently, I'm using a Razor DeathAdder
-
How do I turn off email password remembered?
How can I turn off my password remembered for my email?