a simple select statement once again
What is the meaning of the one below select statement, pay attention to (sysdate + 1.1)
Select (sysdate + 1.1) of the double
Hello
a_cute_person wrote:
Lo, seriously, dude you do not make to_char thing, when I select sysdate, sysdate + 1.1 double I see clearly there is time change, I wanted to know what the weather has changed when I do sysdate + 1.1, and why there is no change in time sysdate + 1. hope you have the hand on what I ask
Understand this:
When you add 1 to SYSDATE, a full day is added. So, if the current time i.e. SYSDATE is January 22, 2015 16:55 ', by adding 1, it will be named January 23, 2015 16:55 '. Simple.
But, 1.1 means one-tenth day and fractional hour comes in picture.
Yes, day 1.1
= 1 + 1/10 of the next whole day
= 24 * 60 * 60 seconds + (1/10) * 24 * 60 * 60 seconds
and here the time portion changes.
HTH.
-Nordine
Tags: Database
Similar Questions
-
If then the clause for a simple select statement.
Good afternoon
I'm sure this will be really simple for a person: I have three paintings that I need to access it in a simple select statement. However, I need to make two separate petitions by a field has an entry or not. Here is the code I wrote so far. It is only to retune the ELSE part, which means that I know I'm close, but I know I'm missing something incredibly simple and boring for me right now.
IF common_event.efeanme IS NULL THEN SELECT a.num_1 AS "EVENT NUMBER", CONCAT(CONCAT(CONCAT(CONCAT(SUBSTR(a.cdts,5,2), '/'), SUBSTR(a.cdts,7,2)), '/'), SUBSTR(a.cdts,1,4)) AS "EVENT DATE", CONCAT(CONCAT(c.xstreet1, ' / '), c.xstreet2) AS "EVENT LOCATION" FROM common_event c JOIN agency_event a ON c.eid=a.eid JOIN disposition_type d ON a.ag_id=d.ag_id WHERE a.ag_id='JCSO' AND a.lev3='JC3' AND a.cdts BETWEEN '20140701' AND '20141001' AND d.tycod='CIT' ORDER BY a.num_1; ELSE SELECT a.num_1 AS "EVENT NUMBER", CONCAT(CONCAT(CONCAT(CONCAT(SUBSTR(a.cdts,5,2), '/'), SUBSTR(a.cdts,7,2)), '/'), SUBSTR(a.cdts,1,4)) AS "EVENT DATE", CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(CONCAT(c.estnum, ' '), c.edirpre), ' '), c.efeanme), ' '), c.efeatyp) AS "EVENT LOCATION" FROM common_event c JOIN agency_event a ON c.eid=a.eid JOIN disposition_type d ON a.ag_id=d.ag_id WHERE a.ag_id='JCSO' AND a.lev3='JC3' AND a.cdts BETWEEN '20140701' AND '20141001' AND d.tycod='CIT' ORDER BY a.num_1; END IF;
If I run a query on its own, it works as expected. Which means that I don't get something right (in my opinion) in my CASE SO the ELSE clause. As I said, it's probably something so simple I forget only she, but I better ask for a direction somewhat see where I'm going to do it right.
Thanks in advance for any guidance.
Tony
Cant you just do:
SELECT a.num_1 'EVENT NUMBER. "
Concat (Concat (Concat (Concat (substr (a.CDTS, 5, 2), ' / '), SUBSTR (a.cdts, 7, 2)), ' / '), SUBSTR (a.cdts, 1, 4)) AS 'EVENT DATE ',.
-case when c.efeanme IS NULL
then CONCAT (CONCAT (c.xstreet1, ' /'), c.xstreet2)
of another CONCAT (CONCAT (CONCAT (CONCAT (CONCAT (CONCAT (c.estnum, ' '), c.edirpre), ' '), c.efeanme), ' '), c.efeatyp)
end AS 'EVENT ADDRESS'
OF common_event c
JOIN THE
agency_event one
WE c.eid = a.eid
JOIN the disposition_type d
ON a.ag_id = d.ag_id
WHERE a.ag_id = 'JCSO.
AND a.lev3 = 'JC3.
AND a.cdts BETWEEN '20140701' AND '20141001'
AND d.tycod = 'CIT '.
ORDER BY a.num_1
Concerning
Etbin
Deleted AND c.efeanme IS NULL
-
drop table t10; create table t10 (seq number, code number, value varchar2(10)); insert into t10 values (1, 10, 'first'); insert into t10 values (2, 10, 'second'); insert into t10 values (3, 10, 'third'); insert into t10 values (1, 20, 'first'); insert into t10 values (2, 20, 'second'); commit; select * from t10;
the result obtained
SQL> select * from t10; SEQ CODE VALUE ---------- ---------- ---------- 1 10 first 2 10 second 3 10 third 1 20 first 2 20 second
can we select it write as simply as possible to return onlythe row that contains the highest SEQ for a CODE
so I would like to
SEQ CODE VALUE ---------- ---------- ---------- 3 10 third 2 20 second
This seems like it should be simple, but the brain is just not see the solution and fried. Thank you.
Hello
GregV wrote:
Hello
Another way:
Select max (seq) Dungeon (last dense_rank command by seq) seq, code, max (value) value of Dungeon (last dense_rank command by seq)
T10
Code group;
You can simplify that:
Max (SEQ)
Get exactly the same results as
Max (SEQ) keep (last dense_rank command by seq)
-
I have data like below
p_no s_text
1-abcdefgh
1 ijklmnop
1 qrstuvwx
what I need, it is print the output as below, I do not want to use sys_connect_by_path and please advise me not to look at the lines of examples of columns
p_no s_text_1 s_text_2 s_text_3
1 abcdefgh ijklmnop qrstuvwx
Strange HM. You have 'only' with the statement.
with tab (p_no, o_text)
as - look here, have you?
(
Select 1, 'asdasd' from dual Union of all the Select 1, 'xcvxcvxc' from dual Union of all the Select 1, 'Souleymane' from dual ) Select P_no, min (case when r = 1 then end s_text) S_text_1,. min (case when r = 2 end s_text) S_text_2,. min (case when r = 3 there end s_text) S_text_3 de) Select p_no, o_text, row_number() over (partition by order p_no by s_text) r of the tab) P_no group; try using this table querry.
Select P_no, min (case when r = 1 then end s_text) S_text_1,.
min (case when r = 2 end s_text) S_text_2,.
min (case when r = 3 there end s_text) S_text_3
de)
Select p_no, o_text, row_number() over (partition by order p_no by s_text) r of
) - put your table here P_no group;
-
Problem with the simple Select statements
Hi experts,
I have with SQL Server and I'm going to hurt when I use the similar syntax in sqlplus to query an Oracle table.
For example... my table contains column SCHID SET in the numeric form. Table has thousands of lines and the SCHID column is filled.
Select TOP 100 AFTSCHAUXDATA SCHID;
Get the "Word FROM key not found where expected" error
Select DISTINCT from AFTSCHAUXDATA SCHID;
Download "no selected lines.
Can someone help me please?
Thank you, JohnCan someone tell me how to find the names of the 20 largest tables (bigger which means that most of the files)?
Once you have updated statistics on the table, you can query the DataDictionary: USER_TABLES/ALL_TABLES/DBA_TABLES.
I'm assuming that user_tables will do:select * from ( select table_name , num_rows from user_tables order by num_rows desc nulls last ) where rownum <= 20;
You can find more explanations about the DataDictionary in the Oracle Online Documentation.
Just do a quick and easy search
http://www.Oracle.com/pls/db112/homepage
or
http://www.Oracle.com/pls/db102/homepage
Depending on your version of the database. -
Set the Variable in the select statement
Hello
Can we define a variable in the select statement.
Example:
Select firstname, lastname
employees;
in this simple select statement we can define x as number?select fname,lname from employees where rownum <= 30;
-
Add more than 2 lines for a select statement without inserting rows in the base table
Hi all
I have a below a simple select statement that is querying a table.
Select * from STUDY_SCHED_INTERVAL_TEMP
where STUDY_KEY = 1063;
but here's the situation. As you can see its return 7 ranks. But I must add
2 rows more... with everything else, default or what exist... except the adding more than 2 lines.
I can't insert in the base table. I want my results to end incrementing by 2 days in
measurement_date_Taken on 01-APR-09... so big measurement_date_taken expected to
end at study_end_Date...
IS IT STILL POSSIBLE WITHOUT INSERT ROWS IN THE TABLE AND PLAYIHY ALL AROUND WITH
THE SELECT STATEMENT?
Sorry if this is confusing... I'm on 10.2.0.3
Published by: S2K on August 13, 2009 14:19Well, I don't know if this request is as beautiful as my lawn, but seems to work even when ;)
I used the "simplified" version, but the principle should work for your table, S2K.
As Frank has already pointed out (and I fell on it while clunging): simply select your already existing lines and union them with the 'missing documents', you calculate the number of days that you are "missing" based on the study_end_date:MHO%xe> alter session set nls_date_language='AMERICAN'; Sessie is gewijzigd. Verstreken: 00:00:00.01 MHO%xe> with t as ( -- generating your data here, simplified by me due to cat and lawn 2 select 1063 study_key 3 , to_date('01-MAR-09', 'dd-mon-rr') phase_start_date 4 , to_date('02-MAR-09', 'dd-mon-rr') measurement_date_taken 5 , to_date('01-APR-09', 'dd-mon-rr') study_end_date 6 from dual union all 7 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('04-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all 8 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('09-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all 9 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('14-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all 10 select 1063, to_date('03-MAR-09', 'dd-mon-rr') , to_date('19-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all 11 select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('23-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual union all 12 select 1063, to_date('22-MAR-09', 'dd-mon-rr') , to_date('30-MAR-09', 'dd-mon-rr') , to_date('01-APR-09', 'dd-mon-rr') from dual 13 ) -- actual query: 14 select study_key 15 , phase_start_date 16 , measurement_date_taken 17 , study_end_date 18 from t 19 union all 20 select study_key 21 , phase_start_date 22 , measurement_date_taken + level -- or rownum 23 , study_end_date 24 from ( select study_key 25 , phase_start_date 26 , measurement_date_taken 27 , study_end_date 28 , add_up 29 from ( 30 select study_key 31 , phase_start_date 32 , measurement_date_taken 33 , study_end_date 34 , study_end_date - max(measurement_date_taken) over (partition by study_key 35 order by measurement_date_taken ) add_up 36 , lead(measurement_date_taken) over (partition by study_key 37 order by measurement_date_taken ) last_rec 38 from t 39 ) 40 where last_rec is null 41 ) 42 where rownum <= add_up 43 connect by level <= add_up; STUDY_KEY PHASE_START_DATE MEASUREMENT_DATE_TA STUDY_END_DATE ---------- ------------------- ------------------- ------------------- 1063 01-03-2009 00:00:00 02-03-2009 00:00:00 01-04-2009 00:00:00 1063 03-03-2009 00:00:00 04-03-2009 00:00:00 01-04-2009 00:00:00 1063 03-03-2009 00:00:00 09-03-2009 00:00:00 01-04-2009 00:00:00 1063 03-03-2009 00:00:00 14-03-2009 00:00:00 01-04-2009 00:00:00 1063 03-03-2009 00:00:00 19-03-2009 00:00:00 01-04-2009 00:00:00 1063 22-03-2009 00:00:00 23-03-2009 00:00:00 01-04-2009 00:00:00 1063 22-03-2009 00:00:00 30-03-2009 00:00:00 01-04-2009 00:00:00 1063 22-03-2009 00:00:00 31-03-2009 00:00:00 01-04-2009 00:00:00 1063 22-03-2009 00:00:00 01-04-2009 00:00:00 01-04-2009 00:00:00 9 rijen zijn geselecteerd.
Is there a simpler way (in SQL), I hope that others join, and share their ideas/example/thoughts.
I feel that it is using more resources there.
But I have to cut the daisies before now, they interfere my 'grass-green-ess";) -
State Bar has disappeared, once again (November 9, 2011)
After a few updates, today disappeared from my status bar, once again, and I can't understand how to get it back. I had status-4-Ever forever, but it's been so long that it happened that I'm not sure what to do. I messed around with it several times and restarted Firefox, but it is not it.
"Ctr /" is the shortcut to activate the module bar, and it's the same as the view > toolbars > (check | uncheck) the module bar.
-
6400 upgrade Hard Drive just SHRUNK... Once again!!!
First of all let me state that I am ready to throw my computer and TWO 2, TWO Yes upgrade hard drives out of my 2nd floor window!
OK, my wind is done, for now.
I have an Inspiron 6400 with HDD 80 GB of origin (73.1 GB space.) I wanted to go to a Western Digital 250 GB hard drive. I bought the drive and cloned it. My first attempt was a purchase Norton Ghost program (after the $150 for the reader, that's another $50 for the program) I cloned it from the laptop via a USB - SATA connection. Everything seemed fine, until I swapped hard drives. He got through the BIOS, no problem, then started to windows. Immediately, it projected blue and that was that. Swap return original hard drive, everything OK. Put old drive in the spare computer/SATA slot and realized that the reader shrunk to 73.1 GB. . the SAME SIZE as the original drive.
After days/weeks and literally probably 5 to 6 hours of troubleshooting, downloading about 4-5 programs, utilities, etc, and have EVERY single utility, test and program otherwise tell me the car was very good (less the fact that he was now 170 GB smaller) I thought that drive was simply bad then returned. (After fighting with Tiger Direct, I had to return it directly to WD, but they at least sent me a replacement unit before that I had to return the first... (where my 'two' drives))
So I have the new, 2nd hard drive in hand and I say to myself that I would be the clone differently, from my desktop (Dell 690) who had a few ports SATA spare on it. I cloned it with a different program and once again, everything seems to be okay. It showed in my office. This time, I've set manually the new disk partitions to what I end up with.)
So I put the new, larger, cloned drive in the computer, booted and BAAM! Exactly the same thing. Blue screen stop... And guess what... The drive is now 73.1 GB. . and once more, there is nothing I can do to bring back to 250 GB... any computer, software, utility, etc. I throw at it or throw it out in...
Back to Western Digital... but this time, I don't know yet what to say or how to proceed.
My questions are:
1. What is happening and why I can't get a 250 GB drive in the machine. (I can't find ANYWHERE a maximum limit of hard drive)
2. any thoughts on how to get my drive to the correct size of declaration?
I'm really steam it... I have never spent so much time on what should be a simple question in my 15 years and more and about 20 + systems of computers through my hands...
Thanks in advance
Blake
Message edited by blakemiller 27/03/2008 17:05
-
Dear all,
We hope that all are doing well.
I need your help once again, my requirement is to write a trigger for "select statement" on a particular table, the name and the date of the user who executed.
your help will be appreciated.
Thanks in advance.
OS: RHEL 6.1
DB: 11.2.0.3
Trigger is not possible on the SELECT statement, you can audit only by database.
Or can save your select queries to application level.
-
Hello
I have this scenario where I have to pass multiple values to a parameter of a procedure of monkey and then collect in another variable (the lines can be multiple).
The parameter must be used in the where clause of the statement select here I create a sample table for the problem.
Create table test_tab (number of trans_id, cmts varchar2 (50));
insert into test_tab values (568890112115, ' wnlb-CMTS-11-04' ");
insert into test_tab values (568890112115, ' wnlb-CMTS-11-04' ");
insert into test_tab values (568890112115, ' wnlb-CMTS-11-01' ");
insert into test_tab values (568890112115, ' wnlb-CMTS-11-01' ");
insert into test_tab values (568890112115, ' wnlb-CMTS-11-01' ");
insert into test_tab values (568890112115, ' wnlb-CMTS-12-02' ");
insert into test_tab values (568890112115, ' wnlb-CMTS-12-02' ");
This is so all cmts have same trans_id but different name
This query gives the result as -
Select the cmts, count (1)
of test_tab
where cmts ("wnlb-cmts-11-04','wnlb-cmts-11-01", "wnlb-CMTS-11-02'")
and trans_id = 568890112115
Cmts group;
COUNTY OF CMTS
WNLB-CMTS-11-04 2
3 WNLB-CMTS-11-01
Now, I want to use this query in a PLSQL block like where I can spend the CMTS collection and trans_id as a scalar variable and once again an OUTPUT parameter that holds the result of the query.
I use OUT parameter because it will be called to the JAVA program.
Here, I write a PACKAGE for it but it gives me compilation error!
create or replace package CMTS_SUCCESS_FAILED_API
is
type t_item_name is table of index varchar2 (50) by pls_integer;
TYPE t_cmts_count () IS RENDERING
CMTS VARCHAR2 (30),
number of NUMBER
);
type t_reseg_dtl is table of index t_cmts_count by pls_integer;
procedure CMTS_SUCCESS_FAILED_RESEG_ORDR (p_item_name t_item_name, p_trans_id in numbers, p_reseg_dtl to t_reseg_dtl);
end CMTS_SUCCESS_FAILED_API;
/
Now that I have created a different PACKAGE BODY, but none don't work!
1.
create or replace package CMTS_SUCCESS_FAILED_API
is
type t_item_name is table of index varchar2 (50) by pls_integer;
TYPE t_cmts_count () IS RENDERING
CMTS VARCHAR2 (30),
number of NUMBER
);
type t_reseg_dtl is table of index t_cmts_count by pls_integer;
procedure CMTS_SUCCESS_FAILED_RESEG_ORDR (p_item_name t_item_name, p_trans_id in numbers, p_reseg_dtl to t_reseg_dtl);
end;
/
create or replace package CMTS_SUCCESS_FAILED_API body
is
procedure CMTS_SUCCESS_FAILED_RESEG_ORDR (p_item_name t_item_name, p_trans_id in numbers, p_reseg_dtl to t_reseg_dtl)
is
Start
I'm in p_item_name.first... p_item_name. Last
loop
Select the cmts, count (1)
bulk collect into p_reseg_dtl (i)
of test_tab
where cmts = p_item_name (i)
and trans_id = p_trans_id
Cmts group;
end loop;
for r in p_reseg_dtl.first... p_reseg_dtl. Last
loop
dbms_output.put_line (p_reseg_dtl (r). TRANSACTION_ID | » '|| p_reseg_dtl (r). JOB_STATUS | » '|| p_reseg_dtl (r). CMTS);
end loop;
end CMTS_SUCCESS_FAILED_RESEG_ORDR;
end CMTS_SUCCESS_FAILED_API;
While I run this procedure it is said TOO_MANY LINES.
2.
create or replace package CMTS_SUCCESS_FAILED_API body
is
procedure CMTS_SUCCESS_FAILED_RESEG_ORDR (p_item_name t_item_name, p_trans_id in numbers, p_reseg_dtl to t_reseg_dtl)
is
cursor c_dtl is
Select the cmts, count (1)
of test_tab
where cmts = p_item_name < < error
and trans_id = p_trans_id
Cmts group;
Start
Open c_dtl;
collect the fetch c_dtl in bulk in p_reseg_dtl;
close c_dtl;
-for i in p_item_name.first... p_item_name. Last
-loop
-end loop;
end;
end;
THIS error GIVES BODY as EXPRESSION IS OF TYPE INCORRECT for where clause where I mark it as "BOLD".
I think Miss me a small detail to add here, but I can't do even now it seems for me that I'm working on it since the morning and SQL are a little complex in real time who also write.
I use-Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
Please suggest me!
Until then I'm also working on this issue hope will find a solution.
In the database (we show it with a standalone function, you should put it in a package):
create or replace function CMTS_SUCCESS_FAILED_RESEG_ORDR ( p_item_name IN SYS.DBMS_DEBUG_VC2COLL, p_trans_id IN number ) return sys_refcursor is l_refcur sys_refcursor; begin open l_refcur for SELECT cmts , COUNT(*) FROM test_tab WHERE cmts member of p_item_name AND trans_id = p_trans_id GROUP BY cmts; return l_refcur; end CMTS_SUCCESS_FAILED_RESEG_ORDR; /
In Java:
import java.math.BigDecimal; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import oracle.jdbc.OracleCallableStatement; import oracle.jdbc.OracleTypes; import oracle.jdbc.pool.OracleDataSource; import oracle.sql.ARRAY; import oracle.sql.ArrayDescriptor; public class SQLCollection { public static void main(String[] args) throws SQLException { System.out.println("Class SQLCollection started."); OracleDataSource ods = null; Connection conn = null; CallableStatement cs = null; ResultSet rset = null; try { ods = new OracleDataSource(); String url = "jdbc:oracle:thin:@//127.0.0.1:1522/orcl.localdomain"; ods.setURL(url); ods.setUser("stew"); ods.setPassword("stew"); conn = ods.getConnection(); conn.setAutoCommit(false); ArrayDescriptor oracleVarchar2Collection = ArrayDescriptor.createDescriptor("SYS.DBMS_DEBUG_VC2COLL", conn); String[] inset = new String[2]; inset[0] = "wnlb-cmts-11-04"; inset[1] = "wnlb-cmts-11-01"; ARRAY ora_inset = new ARRAY(oracleVarchar2Collection, conn, inset); cs = conn.prepareCall("begin ? := CMTS_SUCCESS_FAILED_RESEG_ORDR(?, ?); end;"); cs.registerOutParameter(1, OracleTypes.CURSOR); cs.setArray(2, ora_inset); cs.setBigDecimal(3, new BigDecimal("568890112115")); cs.execute(); // Dump the cursor rset = ((OracleCallableStatement)cs).getCursor(1); while (rset.next()) System.out.println(rset.getString(1) + ": " + rset.getInt(2)); } catch (Exception e) { e.printStackTrace(); } finally { if (rset != null) { rset.close(); } if (cs != null) { cs.close(); } if (conn != null) { conn.close(); } System.out.println("Class SQLCollection ended."); } } }
-
Slow performance due to hitting a great view twice in a SELECT statement
This program is written in Oracle 9i reports but the problem is to do with the SQL, I decided to post the question here and non-Oracle reports. I am interested in finding the 'Pre' and 'All time' result values in this exercise. However, to achieve that, I am struck is large seen complex twice for all kidney patients. I was hoping maybe only hit from this point of view once. If there is no other way, maybe I could watch using a temporary table. I simplified (removed irrelevant columns) and using only 1 patient, so it might seem that my approach works well, but in reality the nature of the view (I have no control on the display), the performance takes a hit. Any help to improve this request would be greatly appreciated.
Scripts to create the tables and insert data:
create table PATIENT_TB (pat_id varchar2(4), start_date date); insert into patient_tb (pat_id,start_date) values ('1001',to_date('10-MAR-14','DD-MON-RR')); create table patient_result_vw (pat_id varchar2(4), renal_test_date date, renal_result_1 varchar2(1), renal_result_2 varchar2(1), renal_result_3 varchar2(1), renal_result_4 varchar2(1)); insert into patient_result_vw (pat_id,renal_test_date,renal_result_1,renal_result_2,renal_result_3,renal_result_4) values ('1001',to_date('01-MAR-14','DD-MON-RR'),'Y','N','N','N'); insert into patient_result_vw (pat_id,renal_test_date,renal_result_1,renal_result_2,renal_result_3,renal_result_4) values ('1001',to_date('01-MAY-14','DD-MON-RR'),'Y','Y','Y','N');
SQL:
The patient_result_vw view is used in the subquery 'pre' and the 'post' subquery and the reason why I have to do it because I need to isolate the values of "pre" before the Start Date. Also note that since I use Oracle reports, I am able to pass as a data link Start Date to the previous query. In any case, patient_tb response time is very fast.
select p.pat_id, pre_renal_result_1_flag, pre_renal_result_2_flag, pre_renal_result_3_flag, pre_renal_result_4_flag, post_renal_result_1_flag, post_renal_result_2_flag, post_renal_result_3_flag, post_renal_result_4_flag from patient_tb p, ( select r.pat_id, max(r.renal_result_1) keep(dense_rank last order by r.renal_result_1 nulls first) pre_renal_result_1_flag, max(r.renal_result_2) keep(dense_rank last order by r.renal_result_1 nulls first) pre_renal_result_2_flag, max(r.renal_result_3) keep(dense_rank last order by r.renal_result_1 nulls first) pre_renal_result_3_flag, max(r.renal_result_4) keep(dense_rank last order by r.renal_result_1 nulls first) pre_renal_result_4_flag from patient_result_vw r where renal_test_date < (select p2.start_date from patient_tb p2 where p2.pat_id = r.pat_id) group by r.pat_id, r.renal_test_date ) pre, ( select r.pat_id, max(r.renal_result_1) keep(dense_rank last order by r.renal_result_1 nulls first) post_renal_result_1_flag, max(r.renal_result_2) keep(dense_rank last order by r.renal_result_1 nulls first) post_renal_result_2_flag, max(r.renal_result_3) keep(dense_rank last order by r.renal_result_1 nulls first) post_renal_result_3_flag, max(r.renal_result_4) keep(dense_rank last order by r.renal_result_1 nulls first) post_renal_result_4_flag from patient_result_vw r group by r.pat_id ) post where p.pat_id = pre.pat_id and p.pat_id = post.pat_id ;
Hello
Roxyrollers wrote:
... From a results point of view, there is a priority as to which the result should be picked up (for pre and Post). I'm supposed to take the highest value (being the highest, then N and then NULL), but before the Start Date. The results of 'Post' (in reality, it's all time results), there is no Date of departure concerned. Once again, the results of the post, I will pick up the highest score (the highest, can N and then white).
...
You want plain old simple MAX for it.
MAX (a) KEEP (DENSE_RANK LAST ORDER BY ter)
is something different: it is the value of a that is related to the highest value of b. Only a tie for the most high b is the value of a same considered.
-
Startup MacBook Pro-comment problems prevent health going to disk/check once again
My 13 inch Macbook Pro running OSX 10.9.5 (said mid-2012, but it was purchased in fall 2014) has had problems starting
A few weeks ago the computer is stuck on the loading screen (white, with the Apple and the buffering of spinning icon) without marketing properly. After you have manually turned off and left for a long time he worked well on the next test, so I took care of it has been saved and so didn't think much, and it works pretty well in recent weeks, sometimes being a little slow but that very occasionally and not debilitatingly so and it probably is not related to this problem.
This morning it was still once stuck on the loading screen, and try again in 5 or 6 times solves nothing. The VRAM reset did not help either. After an attempt to boot into safe mode (filled a little progress bar then disappeared and the computer continued to buffer without purpose), I once again reset the NVRAM and tried a different boot safe mode, with the same results. But this time I left it half an hour or so and on the next attempt (start normally) it miraculously worked a new and everything seems functional. After a new backup with a preparation period slightly extended backup (at least half an hour on the first abandoned attempt, then at least 15 minutes, until correct on the second trial has started), although it is common on my computer, I have enough fear turn the computer off and tempt fate again, if I want to see what can be done now.
What should I do to check the health of the disk, potentially fix it, find out why this is happening and avoid this problem again in the future?
I decided to watch from the disk utility and am confused by the Setup program. There is an 'APPLE HDD Media HTS541010A9E662' entry in the list, with a "MacIntoshHD" paragraph below, and both have different information displayed... I ran check disk on the higher level entry and it seems to be out very well ("the Volume Recovery HD seems to be OK"), but I haven't run one on the low level input as it says my computer may be "slow and unresponsive" while doing so, and I'm not entirely sure of what use there.
It cannot be storage associated with as I stil have 610 gb of free 1 terra (although a large part of what I have (130 GB) is in the other category for a reason any).
How to fix the slow down time and start. | MacTip.net
Resolve startup issues and perform maintenance on disk with disk utility and fsck
Difficulty of slow start in OS X | MacFixIt - CNET Reviews
Repair the hard drive and permissions - Yosemite, Mavericks, Cougar or Lion
HD recovery start:
Restart the computer after the ring, press in and hold the ORDER et R keys until the menu screen to appear.
Repair
When the recovery menu appears, select disk utility and press the continue button. Disk utility charges and select Macintosh HD entry indented from the list on the left. Click the first aid tab, and then click the repair disk button. If disk utility reports any errors that have been corrected, then again run repair disc until no errors are reported. If no errors are reported, click repair permissions . Wait until the operation is complete, then quit disk utility and return to the main menu. Select restart from the Apple menu.
Ways to help make a slow Mac faster
17 reasons why your Mac runs slower than expected
Slow performance of Mac? This Article addresses!
Difficulty of slow start in OS X | MacFixIt - CNET Reviews
How to fix the slow down time and start. | MacTip.net
6 easy tips to speed up OS X Yosemite on your Mac.
Avoid using third-party software that claims to clean your computer. This software does more harm than good. In addition, you don't need it. Note that all computers become slower over time even in the normal conditions of use. Generally, the experienced users erasing the hard drive and do a clean install from scratch at least once a year or every time that the installation of a major upgrade of the OS. Well sure doing so also means that you need to maintain regular and several backups.
Add more RAM or reduce the number of simultaneously executed from applications and utilities. Remove unnecessary software such as anti-malware and that promises to clean your Mac. Look for the runaway process: Runaway applications can shorten the battery life, affect performance and increase the heat and fan acti... See also:
Before Mavericks
Open the activity monitor in the Utilities folder. Select all processes in the drop process . Click the % CPU column heading twice to display in descending order. If find you a process that uses a large amount of time processor (> = 70,) then select the process, and then click the quit icon in the toolbar. Click the force quit button to kill the process. See if that helps. Don't forget to mention the name of the runaway process, so you can find the cause of the problem.
Mavericks and later versions
Open the activity monitor in the Utilities folder. Select all processes in the menu display . Click the CPU tab in the toolbar. Click the % CPU column heading twice to display in descending order. If you find a process that uses a large amount of CPU %, then select the process, then click on the quit icon in the toolbar. Click the force quit button to kill the process. See if that helps. Don't forget to mention the name of the runaway process, so you can find the cause of the problem.
The ultimate solution
Back up everything, wipe the drive, reinstall OS X and restore your data from backup. Reinstall the third-party software of original/zero media.
Start the computer in Safe Mode, and then restart normally. It will be slower than a normal startup.
MacIntel: Reset of the controller (SMC) system management
Reset the PRAM and NVRAM on your Mac.
Now, download and install the update of OS X Mavericks 10.9.5 (Combo)
-
Original title: Disk Defragmenter
I click analyize it is said you should defragment this volume then I run imediatlly once again and he said that I should defragment. again, I have windows Xp IE8 and Ms s essentials do it please answer very clear, I'm not very good with computers, I'm an old guy, thank you.
Hi RichSQL,
Follow these methods.
Method 1: Follow these steps:
Step 1: Relocation of defragmentation
(a) in the disk, find the directory c:\Windows\Inf. If the system directory is not on the c: drive or not named Windows, find by clicking on "Start", then "run" and type %Windir%\Inf in the area.
(b) find the file called dfrg.inf.
(c) right click on the file and select "install".
Step 2: Repair defrag
un) Click on "Start", then "run", run this command: regsvr32 dfrgsnap.dll.
(b) click "Start", then "run" and execute this command: regsvr32 dfrgui.dll.
(c) run Defrag.
Method 2: Follow the steps in the article.
Disk Defragmenter does not work on a Windows XP-based computer
-
When starting, my windows xp hangs or crashes when you try to load 'personal settings '. I can't do something, but stop once again on commissioning, she repeats the same actions. What now? Thank you
Hello
Disconnect all external devices from the computer and try to restart the computer and check what is happening.
Step 1:
Try to boot to the desktop in safe mode and check what is happening. Only basic files and drivers needed to run Windows are started. If a problem doesn't reappear when you start in safe mode, you can eliminate the default settings and basic as possible cause device drivers. To start in safe mode follow the link.
http://support.Microsoft.com/kb/315222
Step 2:
If you are able to boot to the desktop in Mode safe, it means that the third-party application prevents the computer from starting in normal mode. To check you can configure the computer to clean start State and then try to boot into normal mode and check what is happening. To set up its own start-up follow the link below.
http://support.Microsoft.com/kb/310353
If the problem does not continues when the computer is in the clean start State follow the steps listed to identify which application is causing the problem.
Note: When you are finished troubleshooting, follow step 7 article to start on normal startup.
Hope this information is useful.
Amrita M
Microsoft Answers Support Engineer
Visit our Microsoft answers feedback Forum and let us know what you think.
Maybe you are looking for
-
Composition of music to listen to my music?
Why is iTunes saying that I need a music subscription and allow data usuage listen to my music as well as having to redownload the songs I already downloaded on my phone?
-
How can I open firefox in safe mode?
I can find is no longer a way to open firefox in safe mode, I was able to before the latest version
-
Hi all I use an Iphone 5 s 64GB and I was very happy with it. But it turns into a mess since ios 9.3. (13E233). Now, I have the following problems: not possible to open links in Safari and other applications; not possible to use Napster more == > no
-
Enter the power on password administrator password - don't know system off code 60474922 Need code of the entry. Thank you
-
Windows 2008 server and second nic
Hello I added a second NIC on a server win2008r2. The NETWORK adapter has been configured for a different use for dedicated backups segment. I see traffic, send and receive. Public/not identified said interface. I found articles to change privately a