49 | 28 Nov 2013 @ 02:36 PST | Database | Reply | Re-writing a query interms of performance | Sure Deiter,Please find the below explain plan.It is showing as 2 min .But when I execute it,it takes more than 45 mins..
1) First, we lock KEY_T in view
KEY_1 for access, and we lock
... |
48 | 27 Nov 2013 @ 10:29 PST | Database | Topic | Re-writing a query interms of performance | CREATE MULTISET TABLE KEY_T ,NO FALLBACK ,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO
(
DW_CREAT_DT DATE FORMAT 'YYYY-MM-D... |
47 | 20 Nov 2013 @ 03:05 PST | Database | Reply | CASE STATEMENT |
Paste this in SQL assistant to gain understaing of indentation.
CASE WHEN PLNV.LMV_BUS_TYPE_NEW='COR' THEN
CASE WHEN LM_PASS_THRU_EXPRESS_IND = '3' THEN... |
46 | 20 Nov 2013 @ 03:02 PST | Database | Reply | CASE STATEMENT |
CASE
WHEN PLNV.LMV_BUS_TYPE_NEW='COR' THEN
CASE WHEN LM_PASS_THRU_EXPRESS_IND = '3' THEN LV_LX_FUND_PRIN_BAL
&nb... |
45 | 20 Nov 2013 @ 02:31 PST | Database | Reply | Get previous column vale till it reaches another not null value | Yes.I have approached using start and end dates concepts.But still,bcoz of this i came to know one new option in OLAP.Thank you.
|
44 | 20 Nov 2013 @ 02:29 PST | Database | Topic | Adhoc SQL request | CREATE TABLE ORDER_SRC
(
ORDER_ID INTEGER,
ORDER_TEMPLATE_ID INTEGER
);
INSERT INTO ORDER_SRC VALUES(1,3);
INSERT INTO ORDER_SRC VALUES(2,4);
INSERT INTO ORDER_SRC VALUES(3,6);
INSER... |
43 | 15 Nov 2013 @ 03:22 PST | Database | Reply | Get previous column vale till it reaches another not null value | Can you pls repost the link as I am unable to get it..I am seeing a scroll bar only.
|
42 | 15 Nov 2013 @ 03:12 PST | Database | Reply | Get previous column vale till it reaches another not null value | Excellent Saeed! I have never come accrsoo through RESET usage.Really it's an eye-opener.Could you please give me any link that provides more infor RESET usage
|
41 | 15 Nov 2013 @ 02:31 PST | Database | Topic | Get previous column vale till it reaches another not null value | CT LKP(EMPNO INTEGER,TYPE_CD VARCHAR(10),EFF_DT DATE);
INS INTO LKP VALUES(1,'A','2013-01-01');
INS INTO LKP VALUES(1,'B','2014-01-01');
CT MAIN(EMPNO INTEGER,E... |
40 | 23 Oct 2013 @ 02:53 PDT | Database | Topic | DELETE statement taking 2 hours. | Hi
I have table1 with more than 20 million rows.I am trying to delete some rows based on conditions.I have written a query to delete the rows.Butit is taking almost 2 hours.Is there any other way ... |
39 | 22 Oct 2013 @ 05:00 PDT | Database | Reply | Filtering records that have overlapping dates | IDW_Corporate_Service_SSR_101_b
CT T3
(
ID INTEGER,
STARTDATE DATE,
ENDDATE DATE
)
INS INTO T3 VALUES(123,'2013-01-01','2013-08-09')
INS INTO T3 VALUES(123,'2013-0... |
38 | 22 Oct 2013 @ 12:02 PDT | Database | Reply | Adhoc query request | SEL T1.COL1,T1.COL2,T1.COL3,T2.COL2
FROM
(
SEL COL1,COL2,MAX(COL3) OVER(PARTITION BY COL1 ORDER BY COL3) COL3 FROM T1
) T1
LEFT OUTER JOIN
T2 ON T1.COL3 =T2.COL1
|
37 | 17 Oct 2013 @ 02:47 PDT | Database | Topic | Adhoc request | Hi
I have a doubt regarding the following things in Teradata.If I have a particular table then how am i going to find the below things.Do we require a special privilege to look after these o... |
36 | 09 Oct 2013 @ 02:31 PDT | Database | Reply | How to find a third lowest salary without RANK or TOP function | Yes.Got it.Thank you.
|
35 | 08 Oct 2013 @ 11:01 PDT | Database | Topic | How to find a third lowest salary without RANK or TOP function | Hi
I need to find the third lowest salary without using RANK or TOP function?
|
34 | 07 Oct 2013 @ 05:21 PDT | Database | Topic | Anything similar to DENSE_RANK() in Oracle | Hi
I am using TD 13.I have a scenario where I need to represent dates to a sequence.And I have multiple id's for the same date.Each date i would like to represnt a single number only.
It canb... |
33 | 07 Oct 2013 @ 04:08 PDT | Database | Topic | Delete last 35 days data from the table | Hi
I had a table with n days of data.I need to delete last 35 days of data.My table doesnt have consecutive dates i.e. there were no loads in weekends or holidays..
Using INTERVAL command may jus... |
32 | 03 Oct 2013 @ 04:15 PDT | Database | Reply | CASE statement in SQL | Yes.Thank You!!
|
31 | 03 Oct 2013 @ 04:01 PDT | Database | Reply | CASE statement in SQL | COALESCE(ID,'111')<>'123456' where ID is the INTEGER.
|
30 | 03 Oct 2013 @ 03:26 PDT | Database | Reply | CASE statement in SQL | What about the below statement
SELECT CASE WHEN COALESCE(111,111)='111' THEN 'YES' ELSE 'NO' END AS X
It should also return NO.
|
29 | 03 Oct 2013 @ 03:10 PDT | Database | Reply | CASE statement in SQL | Then how to write this case to print YES for the second statement .SELECT CASE WHEN COALESCE(111,'111')='111' THEN 'YES' ELSE 'NO' END AS X
|
28 | 03 Oct 2013 @ 02:27 PDT | Database | Reply | CASE statement in SQL | SEL
CASE WHEN 111='111' THEN 'YES'
ELSE 'NO'
END
Printing YES
SELECT CASE WHEN COALESCE(111,'111')='111' THEN 'YES' ELSE '... |
27 | 03 Oct 2013 @ 02:14 PDT | Database | Reply | CASE statement in SQL | SELECT CASE WHEN COALESCE(111,'111')='111' THEN 'YES' ELSE 'NO' END AS X
it is printing NO..What's the difference??
|
26 | 03 Oct 2013 @ 12:16 PDT | Database | Topic | CASE statement in SQL |
In both the cases,it is printing 'Yes' .Why??
sel
case when 111=cast('111' as char(3)) then 'yes'
else 'no'
end
sel
case when 111='111'&... |
25 | 02 Oct 2013 @ 10:58 PDT | Database | Reply | snap to scd using sql | As per my understanding,
the updated records have CURR_IN=0 and RCV_IN=1.
For active records,CURR_IN=1 and RCV_IN=1 and
for deleted records CURR_IN=1 and RCV_IN=0.
I have done this and strucked... |