Please help me in writing this query
Hi all,
How to do a token match of a string with the token of another mathc
EX:
LET THE FIRST STRINGS WITH A COMMA separated like below
"firsttoken,second,third,are,the,parts,of,a,string"
LET THE SECOND STRING WITH A COMMA separated like below
"this,is,the,search,tokens"
Now I have to match any token of the SECOND string with any TOKEN OF THE FIRST string
If atleast one match is exist then its treated as success..
I need only sql, not pl/sql
Preferrable if analytical functions not used.
Thanks in advance,
Khaleel
Khaleel,
I understand the limitation to use PL/SQL. I have similar kind of limitations at my end, I am not allowed
to leave any custom procedure/function definitions in the db with out taking the permissions for them.
Here is the SQL solution for you for variable number of TOKENS. Only requirement is UPPER BOUND
should be known. You could have variable number of tokens in either of the strings as long as you code it for the maximum number of tokens in each string. Here I coded it for 4 tokens in each string, hence I could use any number of tokens <= 4 in each string. Couple of tests here, -- Strings with different number of tokens but with a matching word
SQL> SELECT DECODE(count(*), 0, 'MATCH NOT FOUND', 'MATCH FOUND') yes_no FROM DUAL,
2 (SELECT DECODE(str1_comma1, 0, str1, SUBSTR(str1, 1, str1_comma1 - 1)) str1_token1,
3 DECODE(str1_comma1, 0, NULL, decode(str1_comma2, 0, SUBSTR(str1, str1_comma1 + 1),
4 SUBSTR(str1, str1_comma1 + 1, str1_comma2 - str1_comma1 - 1))) str1_token2,
5 DECODE(str1_comma2, 0, NULL, decode(str1_comma3, 0, SUBSTR(str1, str1_comma2 + 1 ),
6 SUBSTR(str1, str1_comma2 + 1, str1_comma3 - str1_comma2 - 1))) str1_token3,
7 DECODE(str1_comma3, 0, NULL, SUBSTR(str1, str1_comma3 + 1)) str1_token4,
8 -- string2 tokens
9 DECODE(str2_comma1, 0, str1, SUBSTR(str2, 1, str2_comma1 - 1)) str2_token1,
10 DECODE(str2_comma1, 0, NULL, decode(str2_comma2, 0, SUBSTR(str2, str2_comma1 + 1),
11 SUBSTR(str2, str2_comma1 + 1, str2_comma2 - str2_comma1 - 1))) str2_token2,
12 DECODE(str2_comma2, 0, NULL, decode(str2_comma3, 0, SUBSTR(str2, str2_comma2 + 1 ),
13 SUBSTR(str2, str2_comma2 + 1, str2_comma3 - str2_comma2 - 1))) str2_token3,
14 DECODE(str2_comma3, 0, NULL, SUBSTR(str2, str2_comma3 + 1)) str2_token4
15 FROM
16 (
17 Select A.str1, Instr(A.str1, ',', 1, 1) str1_comma1,
18 Instr(A.str1, ',', 1, 2) str1_comma2,
19 Instr(A.str1, ',', 1, 3) str1_comma3,
20 B.str2, Instr(B.str2, ',', 1, 1) str2_comma1,
21 Instr(B.str2, ',', 1, 2) str2_comma2,
22 Instr(B.str2, ',', 1, 3) str2_comma3
23 From
24 (Select 'Shaik,Khaleel,Java,Solution' str1 from dual) A,
25 (Select 'SriDHAR,SQL,Solution' str2 from dual) B
26 )
27 ) X
28 WHERE X.str2_token1 IN (X.str1_token1, X.str1_token2, X.str1_token3, X.str1_token4)
29 OR X.str2_token2 IN (X.str1_token1, X.str1_token2, X.str1_token3, X.str1_token4)
30 OR X.str2_token3 IN (X.str1_token1, X.str1_token2, X.str1_token3, X.str1_token4)
31 OR X.str2_token4 IN (X.str1_token1, X.str1_token2, X.str1_token3, X.str1_token4)
32 /
YES_NO
MATCH FOUND
-- Strings with same numer of tokens, with no matching word
SQL> SELECT DECODE(count(*), 0, 'MATCH NOT FOUND', 'MATCH FOUND') yes_no FROM DUAL,
2 (SELECT DECODE(str1_comma1, 0, str1, SUBSTR(str1, 1, str1_comma1 - 1)) str1_token1,
3 DECODE(str1_comma1, 0, NULL, decode(str1_comma2, 0, SUBSTR(str1, str1_comma1 + 1),
4 SUBSTR(str1, str1_comma1 + 1, str1_comma2 - str1_comma1 - 1))) str1_token2,
5 DECODE(str1_comma2, 0, NULL, decode(str1_comma3, 0, SUBSTR(str1, str1_comma2 + 1 ),
6 SUBSTR(str1, str1_comma2 + 1, str1_comma3 - str1_comma2 - 1))) str1_token3,
7 DECODE(str1_comma3, 0, NULL, SUBSTR(str1, str1_comma3 + 1)) str1_token4,
8 -- string2 tokens
9 DECODE(str2_comma1, 0, str1, SUBSTR(str2, 1, str2_comma1 - 1)) str2_token1,
10 DECODE(str2_comma1, 0, NULL, decode(str2_comma2, 0, SUBSTR(str2, str2_comma1 + 1),
11 SUBSTR(str2, str2_comma1 + 1, str2_comma2 - str2_comma1 - 1))) str2_token2,
12 DECODE(str2_comma2, 0, NULL, decode(str2_comma3, 0, SUBSTR(str2, str2_comma2 + 1 ),
13 SUBSTR(str2, str2_comma2 + 1, str2_comma3 - str2_comma2 - 1))) str2_token3,
14 DECODE(str2_comma3, 0, NULL, SUBSTR(str2, str2_comma3 + 1)) str2_token4
15 FROM
16 (
17 Select A.str1, Instr(A.str1, ',', 1, 1) str1_comma1,
18 Instr(A.str1, ',', 1, 2) str1_comma2,
19 Instr(A.str1, ',', 1, 3) str1_comma3,
20 B.str2, Instr(B.str2, ',', 1, 1) str2_comma1,
21 Instr(B.str2, ',', 1, 2) str2_comma2,
22 Instr(B.str2, ',', 1, 3) str2_comma3
23 From
24 (Select 'Shaik,Khaleel,Java,Program' str1 from dual) A,
25 (Select 'SriDHAR,SQL,Solution,Possible' str2 from dual) B
26 )
27 ) X
28 WHERE X.str2_token1 IN (X.str1_token1, X.str1_token2, X.str1_token3, X.str1_token4)
29 OR X.str2_token2 IN (X.str1_token1, X.str1_token2, X.str1_token3, X.str1_token4)
30 OR X.str2_token3 IN (X.str1_token1, X.str1_token2, X.str1_token3, X.str1_token4)
31 OR X.str2_token4 IN (X.str1_token1, X.str1_token2, X.str1_token3, X.str1_token4)
32 /
YES_NO
MATCH NOT FOUNDLooks cumbersome, but works. You should be able to take it from here to extend the functionality also,
like if you want to know which words are matching OR which words are not matching etc.., you should be
able to tweak the SQL accordingly.
Good luck,
Thx,
SriDHAR
Similar Messages
-
Please help to re-write this query using exists or with
Hi please help to re-write this query using exists or with, i need to write same code for 45 day , 90 days and so on but sub query condition is same for all
SELECT SUM (DECODE (t_one_mon_c_paid_us, 0, 0, 1)) t_two_y_m_mul_ca_
FROM (SELECT SUM (one_mon_c_paid_us) t_one_mon_c_paid_us
FROM (
SELECT a.individual_id individual_id,
CASE
WHEN NVL
(b.ship_dt,
TO_DATE ('05-MAY-1955')
) >= SYSDATE - 45
AND a.country_cd = 'US'
AND b.individual_id in (
SELECT UNIQUE c.individual_id
FROM order c
WHERE c.prod_cd = 'A'
AND NVL (c.last_payment_dt,
TO_DATE ('05-MAY-1955')
) >= SYSDATE - 745)
THEN 1
ELSE 0
END AS one_mon_c_paid_us
FROM items b, addr a, product d
WHERE b.prod_id = d.prod_id
AND d.affinity_1_cd = 'ADH'
AND b.individual_id = a.individual_id)
GROUP BY individual_id)
Edited by: user4522368 on Aug 23, 2010 9:11 AMPlease try and place \ before and after you code \Could you not remove the inline column select with the following?
SELECT a.individual_id individual_id
,CASE
when b.Ship_dt is null then
3
WHEN b.ship_dt >= SYSDATE - 90
3
WHEN b.ship_dt >= SYSDATE - 45
2
WHEN b.ship_dt >= SYSDATE - 30
1
END AS one_mon_c_paid_us
FROM items b
,addr a
,product d
,order o
WHERE b.prod_id = d.prod_id
AND d.affinity_1_cd = 'ADH'
AND b.individual_id = a.individual_id
AND b.Individual_ID = o.Individual_ID
and o.Prod_CD = 'A'
and NVL (o.last_payment_dt,TO_DATE ('05-MAY-1955') ) >= SYSDATE - 745
and a.Country_CD = 'US' -
Sql Query Tuning. Please help me to tune this query
Hi All ,
I have this problematic Sql . It is taking huge time to execute. It contains a view CIDV, which i think is the bottleneck.
I have pasted the query below. I will be pasting TKPROF and explain plan for the same. Please advice me to tune this query.
SELECT GCC.SEGMENT1 || '.' || GCC.SEGMENT2 || '.' || GCC.SEGMENT3 || '.' ||
GCC.SEGMENT4 || '.' || GCC.SEGMENT5 || '.' || GCC.SEGMENT6 || '.' ||
GCC.SEGMENT7 || '.' || GCC.SEGMENT8 || '.' || GCC.SEGMENT9 OFFSET_ACCOUNT,
OOD.ORGANIZATION_CODE,
CIDV.SUBINVENTORY_CODE OFFSET_SUBINV,
MIL.SEGMENT1 || '.' || MIL.SEGMENT2 || '.' || MIL.SEGMENT3 || '.' ||
MIL.SEGMENT4 || '.' || MIL.SEGMENT5 OFFSET_LOCATOR,
CIDV.LAST_UPDATE_LOGIN
FROM APPS.CST_INV_DISTRIBUTION_V CIDV,
APPS.GL_CODE_COMBINATIONS GCC,
APPS.MTL_ITEM_LOCATIONS MIL,
APPS.ORG_ORGANIZATION_DEFINITIONS OOD
WHERE CIDV.TRANSACTION_ID = :B2
AND CIDV.PRIMARY_QUANTITY = (-1) * :B1
AND CIDV.REFERENCE_ACCOUNT = GCC.CODE_COMBINATION_ID
AND OOD.ORGANIZATION_ID = CIDV.ORGANIZATION_ID
AND MIL.INVENTORY_LOCATION_ID = CIDV.LOCATOR_ID
AND GCC.ACCOUNT_TYPE = 'A'****************
TKPROF
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 68337 10.32 10.32 0 0 0 0
Fetch 68337 229.75 936.36 58819 6743323 1121 68232
total 136675 240.07 946.69 58819 6743323 1121 68232
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 203 (recursive depth: 1)
Number of plan statistics captured: 1
Rows (1st) Rows (avg) Rows (max) Row Source Operation
1 1 1 MERGE JOIN CARTESIAN (cr=102 pr=15 pw=0 time=193608 us cost=56 size=219 card=1)
1 1 1 NESTED LOOPS (cr=100 pr=15 pw=0 time=193483 us cost=53 size=219 card=1)
1 1 1 NESTED LOOPS (cr=99 pr=15 pw=0 time=193407 us cost=52 size=215 card=1)
1 1 1 NESTED LOOPS (cr=96 pr=15 pw=0 time=193378 us cost=51 size=190 card=1)
1 1 1 NESTED LOOPS (cr=93 pr=15 pw=0 time=193284 us cost=49 size=162 card=1)
1 1 1 NESTED LOOPS (cr=89 pr=14 pw=0 time=185515 us cost=46 size=138 card=1)
1 1 1 NESTED LOOPS (cr=85 pr=12 pw=0 time=157975 us cost=44 size=81 card=1)
1 1 1 NESTED LOOPS (cr=83 pr=12 pw=0 time=157925 us cost=43 size=73 card=1)
1 1 1 NESTED LOOPS (cr=81 pr=12 pw=0 time=157641 us cost=43 size=132 card=2)
1 1 1 VIEW CST_INV_DISTRIBUTION_V (cr=78 pr=12 pw=0 time=156386 us cost=41 size=118 card=2)
1 1 1 UNION-ALL (cr=78 pr=12 pw=0 time=156378 us)
0 0 0 NESTED LOOPS OUTER (cr=44 pr=9 pw=0 time=124997 us cost=20 size=291 card=1)
0 0 0 NESTED LOOPS (cr=44 pr=9 pw=0 time=124993 us cost=18 size=255 card=1)
0 0 0 NESTED LOOPS (cr=44 pr=9 pw=0 time=124990 us cost=18 size=251 card=1)
33 33 33 MERGE JOIN CARTESIAN (cr=25 pr=6 pw=0 time=98544 us cost=14 size=192 card=1)
1 1 1 NESTED LOOPS OUTER (cr=22 pr=5 pw=0 time=85754 us cost=12 size=156 card=1)
1 1 1 NESTED LOOPS (cr=19 pr=4 pw=0 time=79830 us cost=10 size=120 card=1)
1 1 1 NESTED LOOPS OUTER (cr=17 pr=4 pw=0 time=79813 us cost=9 size=113 card=1)
1 1 1 NESTED LOOPS (cr=15 pr=4 pw=0 time=79752 us cost=8 size=106 card=1)
1 1 1 NESTED LOOPS (cr=11 pr=2 pw=0 time=43120 us cost=6 size=93 card=1)
1 1 1 NESTED LOOPS (cr=7 pr=2 pw=0 time=43087 us cost=4 size=83 card=1)
1 1 1 NESTED LOOPS (cr=6 pr=2 pw=0 time=43072 us cost=4 size=80 card=1)
1 1 1 TABLE ACCESS BY INDEX ROWID MTL_MATERIAL_TRANSACTIONS (cr=5 pr=2 pw=0 time=43042 us cost=4 size=76 card=1)
1 1 1 INDEX UNIQUE SCAN MTL_MATERIAL_TRANSACTIONS_U1 (cr=4 pr=2 pw=0 time=43011 us cost=3 size=0 card=1)(object id 12484094)
1 1 1 INDEX UNIQUE SCAN MTL_TRANSACTION_TYPES_U1 (cr=1 pr=0 pw=0 time=20 us cost=0 size=764 card=191)(object id 9983)
1 1 1 INDEX UNIQUE SCAN MTL_TXN_SOURCE_TYPES_U1 (cr=1 pr=0 pw=0 time=7 us cost=0 size=54 card=18)(object id 9987)
1 1 1 INDEX UNIQUE SCAN MTL_SYSTEM_ITEMS_B_U1 (cr=4 pr=0 pw=0 time=27 us cost=2 size=736324450 card=73632445)(object id 12484155)
1 1 1 INDEX UNIQUE SCAN MTL_SYSTEM_ITEMS_TL_U1 (cr=4 pr=2 pw=0 time=36626 us cost=2 size=957481070 card=73652390)(object id 12484137)
1 1 1 TABLE ACCESS BY INDEX ROWID MTL_PARAMETERS (cr=2 pr=0 pw=0 time=42 us cost=1 size=3290 card=470)
1 1 1 INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=1 pr=0 pw=0 time=28 us cost=0 size=0 card=1)(object id 9847)
1 1 1 TABLE ACCESS BY INDEX ROWID MTL_PARAMETERS (cr=2 pr=0 pw=0 time=12 us cost=1 size=3290 card=470)
1 1 1 INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=1 pr=0 pw=0 time=7 us cost=0 size=0 card=1)(object id 9847)
0 0 0 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=3 pr=1 pw=0 time=5915 us cost=2 size=36 card=1)(object id 705891)
33 33 33 BUFFER SORT (cr=3 pr=1 pw=0 time=12713 us cost=12 size=36 card=1)
33 33 33 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=3 pr=1 pw=0 time=12582 us cost=2 size=36 card=1)(object id 705891)
0 0 0 TABLE ACCESS BY INDEX ROWID MTL_TRANSACTION_ACCOUNTS (cr=19 pr=3 pw=0 time=26591 us cost=4 size=59 card=1)
66 66 66 INDEX RANGE SCAN MTL_TRANSACTION_ACCOUNTS_N1 (cr=18 pr=2 pw=0 time=13607 us cost=3 size=0 card=3)(object id 12484127)
0 0 0 INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=0 pr=0 pw=0 time=0 us cost=0 size=4 card=1)(object id 9847)
0 0 0 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=0 pr=0 pw=0 time=0 us cost=2 size=36 card=1)(object id 705891)
1 1 1 NESTED LOOPS (cr=34 pr=3 pw=0 time=31269 us cost=21 size=288 card=1)
1 1 1 NESTED LOOPS (cr=30 pr=3 pw=0 time=31161 us cost=19 size=275 card=1)
1 1 1 NESTED LOOPS (cr=26 pr=3 pw=0 time=31105 us cost=17 size=265 card=1)
1 1 1 NESTED LOOPS (cr=25 pr=3 pw=0 time=31082 us cost=17 size=261 card=1)
1 1 1 NESTED LOOPS OUTER (cr=23 pr=3 pw=0 time=31027 us cost=16 size=254 card=1)
1 1 1 NESTED LOOPS (cr=21 pr=3 pw=0 time=30980 us cost=15 size=247 card=1)
1 1 1 NESTED LOOPS (cr=20 pr=3 pw=0 time=30957 us cost=15 size=243 card=1)
1 1 1 NESTED LOOPS OUTER (cr=19 pr=3 pw=0 time=30926 us cost=15 size=240 card=1)
1 1 1 NESTED LOOPS (cr=16 pr=3 pw=0 time=30389 us cost=13 size=204 card=1)
1 1 1 NESTED LOOPS (cr=11 pr=0 pw=0 time=665 us cost=9 size=131 card=1)
1 1 1 NESTED LOOPS OUTER (cr=8 pr=0 pw=0 time=306 us cost=7 size=95 card=1)
1 1 1 TABLE ACCESS BY INDEX ROWID MTL_TRANSACTION_ACCOUNTS (cr=5 pr=0 pw=0 time=37 us cost=5 size=59 card=1)
2 2 2 INDEX RANGE SCAN MTL_TRANSACTION_ACCOUNTS_N1 (cr=4 pr=0 pw=0 time=17 us cost=4 size=0 card=3)(object id 12484127)
1 1 1 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=3 pr=0 pw=0 time=216 us cost=2 size=36 card=1)(object id 705891)
1 1 1 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=3 pr=0 pw=0 time=352 us cost=2 size=36 card=1)(object id 705891)
1 1 1 TABLE ACCESS BY INDEX ROWID MTL_MATERIAL_TRANSACTIONS (cr=5 pr=3 pw=0 time=29716 us cost=4 size=73 card=1)
1 1 1 INDEX RANGE SCAN MTL_MATERIAL_TRANSACTIONS_N23 (cr=4 pr=3 pw=0 time=29588 us cost=3 size=0 card=1)(object id 12484133)
0 0 0 INDEX RANGE SCAN FND_LOOKUP_VALUES_U1 (cr=3 pr=0 pw=0 time=520 us cost=2 size=36 card=1)(object id 705891)
1 1 1 INDEX UNIQUE SCAN MTL_TXN_SOURCE_TYPES_U1 (cr=1 pr=0 pw=0 time=22 us cost=0 size=3 card=1)(object id 9987)
1 1 1 INDEX UNIQUE SCAN MTL_TRANSACTION_TYPES_U1 (cr=1 pr=0 pw=0 time=16 us cost=0 size=4 card=1)(object id 9983)
1 1 1 TABLE ACCESS BY INDEX ROWID MTL_PARAMETERS (cr=2 pr=0 pw=0 time=34 us cost=1 size=7 card=1)
1 1 1 INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=1 pr=0 pw=0 time=19 us cost=0 size=0 card=1)(object id 9847)
1 1 1 TABLE ACCESS BY INDEX ROWID MTL_PARAMETERS (cr=2 pr=0 pw=0 time=44 us cost=1 size=7 card=1)
1 1 1 INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=1 pr=0 pw=0 time=14 us cost=0 size=0 card=1)(object id 9847)
1 1 1 INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=1 pr=0 pw=0 time=13 us cost=0 size=4 card=1)(object id 9847)
1 1 1 INDEX UNIQUE SCAN MTL_SYSTEM_ITEMS_B_U1 (cr=4 pr=0 pw=0 time=49 us cost=2 size=10 card=1)(object id 12484155)
1 1 1 INDEX UNIQUE SCAN MTL_SYSTEM_ITEMS_TL_U1 (cr=4 pr=0 pw=0 time=96 us cost=2 size=13 card=1)(object id 12484137)
1 1 1 TABLE ACCESS BY INDEX ROWID HR_ALL_ORGANIZATION_UNITS (cr=3 pr=0 pw=0 time=1246 us cost=1 size=7 card=1)
1 1 1 INDEX UNIQUE SCAN HR_ORGANIZATION_UNITS_PK (cr=2 pr=0 pw=0 time=24 us cost=0 size=0 card=1)(object id 250158)
1 1 1 INDEX UNIQUE SCAN HR_ALL_ORGANIZATION_UNTS_TL_PK (cr=2 pr=0 pw=0 time=275 us cost=0 size=7 card=1)(object id 689101)
1 1 1 TABLE ACCESS BY INDEX ROWID MTL_PARAMETERS (cr=2 pr=0 pw=0 time=38 us cost=1 size=8 card=1)
1 1 1 INDEX UNIQUE SCAN MTL_PARAMETERS_U1 (cr=1 pr=0 pw=0 time=15 us cost=0 size=0 card=1)(object id 9847)
1 1 1 TABLE ACCESS BY INDEX ROWID GL_CODE_COMBINATIONS (cr=4 pr=2 pw=0 time=27531 us cost=2 size=57 card=1)
1 1 1 INDEX UNIQUE SCAN GL_CODE_COMBINATIONS_U1 (cr=3 pr=1 pw=0 time=19925 us cost=1 size=0 card=1)(object id 51426)
1 1 1 TABLE ACCESS BY INDEX ROWID MTL_ITEM_LOCATIONS (cr=4 pr=1 pw=0 time=7758 us cost=3 size=24 card=1)
1 1 1 INDEX RANGE SCAN MTL_ITEM_LOCATIONS_U1 (cr=3 pr=0 pw=0 time=51 us cost=2 size=0 card=1)(object id 9761)
1 1 1 TABLE ACCESS BY INDEX ROWID HR_ORGANIZATION_INFORMATION (cr=3 pr=0 pw=0 time=85 us cost=2 size=28 card=1)
1 1 1 INDEX RANGE SCAN HR_ORGANIZATION_INFORMATIO_FK2 (cr=2 pr=0 pw=0 time=29 us cost=1 size=0 card=2)(object id 5379798)
1 1 1 TABLE ACCESS BY INDEX ROWID HR_ORGANIZATION_INFORMATION (cr=3 pr=0 pw=0 time=25 us cost=1 size=25 card=1)
1 1 1 INDEX RANGE SCAN HR_ORGANIZATION_INFORMATIO_FK2 (cr=2 pr=0 pw=0 time=11 us cost=1 size=0 card=1)(object id 5379798)
1 1 1 INDEX FULL SCAN GL_SETS_OF_BOOKS_U2 (cr=1 pr=0 pw=0 time=69 us cost=1 size=4 card=1)(object id 1380842)
1 1 1 BUFFER SORT (cr=2 pr=0 pw=0 time=110 us cost=55 size=0 card=1)
1 1 1 TABLE ACCESS FULL FND_PRODUCT_GROUPS (cr=2 pr=0 pw=0 time=59 us cost=3 size=0 card=1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
library cache lock 2 0.00 0.00
library cache pin 2 0.00 0.00
Disk file operations I/O 249 0.00 0.00
db file sequential read 58819 2.61 714.28
gc cr grant 2-way 5198 0.16 4.52
gc current grant busy 1 0.00 0.00
KJC: Wait for msg sends to complete 517 0.00 0.05
library cache: mutex X 433 0.01 0.04
gc cr grant congested 28 0.08 0.18
latch: ges resource hash list 5 0.00 0.00
gc current block 2-way 513 0.11 0.61
gc current block congested 2 0.00 0.00
latch: gc element 16 0.00 0.01
latch: cache buffers chains 4 0.00 0.00
latch: object queue header operation 3 0.00 0.00
********************************************************************************Explain Plan for the query
SELECT STATEMENT, GOAL = ALL_ROWS Cost=56 Cardinality=1 Bytes=219
MERGE JOIN CARTESIAN Cost=56 Cardinality=1 Bytes=219
NESTED LOOPS Cost=53 Cardinality=1 Bytes=219
NESTED LOOPS Cost=52 Cardinality=1 Bytes=215
NESTED LOOPS Cost=51 Cardinality=1 Bytes=190
NESTED LOOPS Cost=49 Cardinality=1 Bytes=162
NESTED LOOPS Cost=46 Cardinality=1 Bytes=138
NESTED LOOPS Cost=44 Cardinality=1 Bytes=81
NESTED LOOPS Cost=43 Cardinality=1 Bytes=73
NESTED LOOPS Cost=43 Cardinality=2 Bytes=132
VIEW Object owner=APPS Object name=CST_INV_DISTRIBUTION_V Cost=41 Cardinality=2 Bytes=118
UNION-ALL
NESTED LOOPS OUTER Cost=20 Cardinality=1 Bytes=291
NESTED LOOPS Cost=18 Cardinality=1 Bytes=255
NESTED LOOPS Cost=18 Cardinality=1 Bytes=251
MERGE JOIN CARTESIAN Cost=14 Cardinality=1 Bytes=192
NESTED LOOPS OUTER Cost=12 Cardinality=1 Bytes=156
NESTED LOOPS Cost=10 Cardinality=1 Bytes=120
NESTED LOOPS OUTER Cost=9 Cardinality=1 Bytes=113
NESTED LOOPS Cost=8 Cardinality=1 Bytes=106
NESTED LOOPS Cost=6 Cardinality=1 Bytes=93
NESTED LOOPS Cost=4 Cardinality=1 Bytes=83
NESTED LOOPS Cost=4 Cardinality=1 Bytes=80
TABLE ACCESS BY INDEX ROWID Object owner=INV Object name=MTL_MATERIAL_TRANSACTIONS Cost=4 Cardinality=1 Bytes=76
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_MATERIAL_TRANSACTIONS_U1 Cost=3 Cardinality=1
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_TRANSACTION_TYPES_U1 Cost=0 Cardinality=191 Bytes=764
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_TXN_SOURCE_TYPES_U1 Cost=0 Cardinality=18 Bytes=54
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_SYSTEM_ITEMS_B_U1 Cost=2 Cardinality=73632445 Bytes=736324450
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_SYSTEM_ITEMS_TL_U1 Cost=2 Cardinality=73652390 Bytes=957481070
TABLE ACCESS BY INDEX ROWID Object owner=INV Object name=MTL_PARAMETERS Cost=1 Cardinality=470 Bytes=3290
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_PARAMETERS_U1 Cost=0 Cardinality=1
TABLE ACCESS BY INDEX ROWID Object owner=INV Object name=MTL_PARAMETERS Cost=1 Cardinality=470 Bytes=3290
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_PARAMETERS_U1 Cost=0 Cardinality=1
INDEX RANGE SCAN Object owner=APPLSYS Object name=FND_LOOKUP_VALUES_U1 Cost=2 Cardinality=1 Bytes=36
BUFFER SORT Cost=12 Cardinality=1 Bytes=36
INDEX RANGE SCAN Object owner=APPLSYS Object name=FND_LOOKUP_VALUES_U1 Cost=2 Cardinality=1 Bytes=36
TABLE ACCESS BY INDEX ROWID Object owner=INV Object name=MTL_TRANSACTION_ACCOUNTS Cost=4 Cardinality=1 Bytes=59
INDEX RANGE SCAN Object owner=INV Object name=MTL_TRANSACTION_ACCOUNTS_N1 Cost=3 Cardinality=3
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_PARAMETERS_U1 Cost=0 Cardinality=1 Bytes=4
INDEX RANGE SCAN Object owner=APPLSYS Object name=FND_LOOKUP_VALUES_U1 Cost=2 Cardinality=1 Bytes=36
NESTED LOOPS Cost=21 Cardinality=1 Bytes=288
NESTED LOOPS Cost=19 Cardinality=1 Bytes=275
NESTED LOOPS Cost=17 Cardinality=1 Bytes=265
NESTED LOOPS Cost=17 Cardinality=1 Bytes=261
NESTED LOOPS OUTER Cost=16 Cardinality=1 Bytes=254
NESTED LOOPS Cost=15 Cardinality=1 Bytes=247
NESTED LOOPS Cost=15 Cardinality=1 Bytes=243
NESTED LOOPS OUTER Cost=15 Cardinality=1 Bytes=240
NESTED LOOPS Cost=13 Cardinality=1 Bytes=204
NESTED LOOPS Cost=9 Cardinality=1 Bytes=131
NESTED LOOPS OUTER Cost=7 Cardinality=1 Bytes=95
TABLE ACCESS BY INDEX ROWID Object owner=INV Object name=MTL_TRANSACTION_ACCOUNTS Cost=5 Cardinality=1 Bytes=59
INDEX RANGE SCAN Object owner=INV Object name=MTL_TRANSACTION_ACCOUNTS_N1 Cost=4 Cardinality=3
INDEX RANGE SCAN Object owner=APPLSYS Object name=FND_LOOKUP_VALUES_U1 Cost=2 Cardinality=1 Bytes=36
INDEX RANGE SCAN Object owner=APPLSYS Object name=FND_LOOKUP_VALUES_U1 Cost=2 Cardinality=1 Bytes=36
TABLE ACCESS BY INDEX ROWID Object owner=INV Object name=MTL_MATERIAL_TRANSACTIONS Cost=4 Cardinality=1 Bytes=73
INDEX RANGE SCAN Object owner=INV Object name=MTL_MATERIAL_TRANSACTIONS_N23 Cost=3 Cardinality=1
INDEX RANGE SCAN Object owner=APPLSYS Object name=FND_LOOKUP_VALUES_U1 Cost=2 Cardinality=1 Bytes=36
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_TXN_SOURCE_TYPES_U1 Cost=0 Cardinality=1 Bytes=3
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_TRANSACTION_TYPES_U1 Cost=0 Cardinality=1 Bytes=4
TABLE ACCESS BY INDEX ROWID Object owner=INV Object name=MTL_PARAMETERS Cost=1 Cardinality=1 Bytes=7
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_PARAMETERS_U1 Cost=0 Cardinality=1
TABLE ACCESS BY INDEX ROWID Object owner=INV Object name=MTL_PARAMETERS Cost=1 Cardinality=1 Bytes=7
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_PARAMETERS_U1 Cost=0 Cardinality=1
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_PARAMETERS_U1 Cost=0 Cardinality=1 Bytes=4
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_SYSTEM_ITEMS_B_U1 Cost=2 Cardinality=1 Bytes=10
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_SYSTEM_ITEMS_TL_U1 Cost=2 Cardinality=1 Bytes=13
TABLE ACCESS BY INDEX ROWID Object owner=HR Object name=HR_ALL_ORGANIZATION_UNITS Cost=1 Cardinality=1 Bytes=7
INDEX UNIQUE SCAN Object owner=HR Object name=HR_ORGANIZATION_UNITS_PK Cost=0 Cardinality=1
INDEX UNIQUE SCAN Object owner=HR Object name=HR_ALL_ORGANIZATION_UNTS_TL_PK Cost=0 Cardinality=1 Bytes=7
TABLE ACCESS BY INDEX ROWID Object owner=INV Object name=MTL_PARAMETERS Cost=1 Cardinality=1 Bytes=8
INDEX UNIQUE SCAN Object owner=INV Object name=MTL_PARAMETERS_U1 Cost=0 Cardinality=1
TABLE ACCESS BY INDEX ROWID Object owner=GL Object name=GL_CODE_COMBINATIONS Cost=2 Cardinality=1 Bytes=57
INDEX UNIQUE SCAN Object owner=GL Object name=GL_CODE_COMBINATIONS_U1 Cost=1 Cardinality=1
TABLE ACCESS BY INDEX ROWID Object owner=INV Object name=MTL_ITEM_LOCATIONS Cost=3 Cardinality=1 Bytes=24
INDEX RANGE SCAN Object owner=INV Object name=MTL_ITEM_LOCATIONS_U1 Cost=2 Cardinality=1
TABLE ACCESS BY INDEX ROWID Object owner=HR Object name=HR_ORGANIZATION_INFORMATION Cost=2 Cardinality=1 Bytes=28
INDEX RANGE SCAN Object owner=HR Object name=HR_ORGANIZATION_INFORMATIO_FK2 Cost=1 Cardinality=2
TABLE ACCESS BY INDEX ROWID Object owner=HR Object name=HR_ORGANIZATION_INFORMATION Cost=1 Cardinality=1 Bytes=25
INDEX RANGE SCAN Object owner=HR Object name=HR_ORGANIZATION_INFORMATIO_FK2 Cost=1 Cardinality=1
INDEX FULL SCAN Object owner=GL Object name=GL_SETS_OF_BOOKS_U2 Cost=1 Cardinality=1 Bytes=4
BUFFER SORT Cost=55 Cardinality=1
TABLE ACCESS FULL Object owner=APPLSYS Object name=FND_PRODUCT_GROUPS Cost=3 Cardinality=1 -
Help with re-writing this query
Dear experts;
create table t2
ID varchar2(1000),
name varchar2(1000),
place varchar2(1000)
create table mappingt2
grades varchar2(1000)
individual varchar2(1000)
insert into t2 values ('James', 'John', 'newyork');
insert into t2 values ('Linda', 'James', 'London');
insert into t2 values ('Alex', 'kim', 'Mexico');
insert into t2 values ('karen', 'Jack', 'Tunis');
insert into t2 values ('CC', 'Jack', 'Peru');
insert into t2 values ('Linda', 'James', 'Germany');
insert into mappingt2 values ('A', 'James');
insert into mappingt2 values ('C', 'Kim');
insert into mappingt2 values ('C', 'Linda');
insert into mappingt2 values ('B', 'CC');I have the following query below
SELECT (select grades from mappingt2 t
where t.individual = pt.ID) as current_grade
,(select grades from mappingt2 ty
where ty.individual = pt.name) alt_grade
,pt.place
FROM t2 ptI was just wondering whether this query can be better written. All help is appreciated. Thank youuser13328581 wrote:
Hi Frank, Tom Kyte claims sub scalar queries is usually betterHe didn't say usually he said if you want the first row faster
>
if your goal is to optimize your query for initial response time, you may want to use the former query, with the scalar subquery, because Oracle Database would have to get just the first row from DEPT, run the scalar subquery (select count...) against EMP to get the count, and then return it. The process for returning that first row would be very fast.
>
The corollary to this that was not explicitly mentioned in the article that I can see is that this probably comes at the expense of the time taken to return all the rows which can then take longer. -
PLease help me in wrirting this query
Hi all,
i want to write a query using standard emp table.But output required is like
deptno ename
10 smith
alen
mark
20 ram
hanuman
Thus if deptno is same for some employees it should be printed once only
Any help is highly appreciatedSQL> select decode(row_number() over(partition by deptno order by ename),1, deptno, '') deptno,
2 ename
3 from emp
4 /
DEPTNO ENAME
10 CLARK
KING
MILLER
20 ADAMS
FORD
JONES
SCOTT
SMITH
30 ALLEN
BLAKE
JAMES
MARTIN
TURNER
WARD
14 rows selected.or just in SQLPLUS for display purpose
SQL> break on deptno
SQL> select deptno, ename from emp order by deptno, ename
2 /
DEPTNO ENAME
10 CLARK
KING
MILLER
20 ADAMS
FORD
JONES
SCOTT
SMITH
30 ALLEN
BLAKE
JAMES
MARTIN
TURNER
WARD
14 rows selected.Edited by: Karthick_Arp on Jun 1, 2009 11:33 PM -
Help me in writing this query plz....
There are two tables - Table1 (table1_id, value1) and Table2 (table2_id,
table1_id, value2). The field Table2.table1_id is a foreign key to
Table1.table1_id. It is necessary to write a SQL query that would find
all records in Table1 that do not have a corresponding record in Table2.
The query should not use sub-selectsuser554495 wrote:
Can you provide me the queryNo, we're not about to do your homework for you. How do you expect to learn anything if all the answers are served to you on a silver platter?
Try and work it out for yourself; if you get stuck, we'll try and help from that point, but you'd have to provide the sql queries you've tried (along with table information and sample input and expected output data). -
Please help me to build this query
hi,
i have two tables a and b.
i am inserting data into table a.
i am inserting same data into table b.
but i need to eleminate any duplicate rows in table b.
this work should be done using trigger.
means we need to write on insert trigger while inserting data into table a
at the same time need to insert data into table b.
final tables like this
table a
col1
1234
1234
1234
5678
5678
3456
3456
3456
table b
1234
5678
3456
i really apricate your time and helphi
thanks for your great support.
if my table haveing more than 40 columns how can i
write these queries
insert into b (col1, col2) values (:new.col1,
:new.col2);RTFM*: http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#SQLRF01604
update b set col2=:new.col2 where col1=:new.col1;RTFM*: http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10007.htm#SQLRF01708
I'll assume (since you didn't provide any details) that your unique key is composed of col1 and col3, for example. Then your update will be...
update b set col2=:new.col2, col4=:new.col4, col5=:new.col5 ... col40=:new.col40
where col1 = :new.col1 and col3 = :new.col3;
*Read The "Fascinating" Manual if you want to learn the syntax. -
Please help me re write this query
select case
when MONTHS>=6 then YRS++
else YRS
end,
from some_tab
Edited by: user9027633 on Feb 25, 2010 1:44 AMHi,
It sounds like you want to round the length of service to the nearest year; the rounded figure may as much as 6 months more or less than the actual length of service.
How to do that depends on your data.
If you have 2 separate columns, months (a number, where 0 <= months < 12) and yrs (an integer) then you could say
select case
when MONTHS >= 6 then YRS+1
else YRS
end AS rounded_service_years
from some_tab
;but you might find it easier to say:
select ROUND (yrs + (months / 12)) AS rounded_service_years
from some_tab
; -
Urgent Help required in Tunning this query
I have table ACCOUNT SPONSOR HOMESTORE ASH with more than 30 million rows.
My batch daily need to update or insert into this table from a temporary table TEMP_HSTRALCT. The data for temporary table is populated by below query which selects from two tables TRANSACTION POINTS and REDEMPTIONS.However both these tables are partitioned on date time and is run daily and this is running for hours.
Can anyone please help me on tuning this query
INSERT INTO temp_hstralct
(tmp_n_collector_account_num, tmp_v_location_id,
tmp_v_sponsor_id, tmp_v_source_file_name,
tmp_n_psc_insert_ind, tmp_n_psc_update_ind,
tmp_n_transaction_amount, tmp_n_transaction_points,
tmp_n_acc_insert_ind, tmp_n_ash_insert_ind,
tmp_n_col_insert_ind, tmp_n_check_digit,
tmp_n_collector_issue_num, tmp_n_csl_insert_ind,
tmp_v_offer_code, tmp_n_psa_insert_ind)
SELECT DISTINCT trp_n_collector_account_num account_num,
trp_v_location_id location_id,
trp_v_sponsor_id sponsor_id,
trp_c_creation_user batch_id, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
FROM transaction_points, ACCOUNT, locations_master,homestores
WHERE hsr_v_accrual_allowed = 'Y'
AND trp_n_collector_account_num = ACCOUNT.acc_n_account_num(+)
AND ( ( ( ACCOUNT.acc_v_account_type = 'C'
OR ACCOUNT.acc_v_account_type IS NULL
AND hsr_v_b2c_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'B'
AND hsr_v_nfb_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'H'
AND hsr_v_hybrid_accounts = 'Y'
AND trp_d_creation_date_time BETWEEN SYSDATE-3
AND SYSDATE
AND trp_v_sponsor_id = 'JSAINSBURY'
AND trp_v_location_id =
locations_master.lnm_v_location_id
AND locations_master.lnm_v_partner_id = 'JSAINSBURY'
AND ( ( ( (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND (INSTR
(hsr_v_store_type,
locations_master.lnm_c_location_type
) > 0
AND hsr_v_homestore_assignment = 'ST'
OR ( ( locations_master.lnm_c_homestore_ind =
'Y'
AND (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND hsr_v_homestore_assignment = 'HS'
UNION ALL
SELECT DISTINCT rdm_n_collector_account_num account_num,
rdm_v_location_id location_id,
rom_v_supplier_id sponsor_id,
rdm_c_creation_user batch_id, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0
FROM redemption_details,
reward_offer_master,
ACCOUNT,
locations_master,
HOMESTORES
WHERE hsr_v_redemption_allowed = 'Y'
AND rdm_n_collector_account_num = ACCOUNT.acc_n_account_num(+)
AND ( ( ( ACCOUNT.acc_v_account_type = 'C'
OR ACCOUNT.acc_v_account_type IS NULL
AND hsr_v_b2c_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'B'
AND hsr_v_nfb_accounts = 'Y'
OR ( ACCOUNT.acc_v_account_type = 'H'
AND hsr_v_hybrid_accounts = 'Y'
AND rdm_d_creation_date_time BETWEEN SYSDATE-3
AND SYSDATE
AND rom_v_reward_offer_id = rdm_v_reward_id
AND rom_v_supplier_id = 'JSAINSBURY'
AND rdm_v_location_id =
locations_master.lnm_v_location_id
AND locations_master.lnm_v_partner_id ='JSAINSBURY'
AND ( ( ( (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND (INSTR
(hsr_v_store_type,
locations_master.lnm_c_location_type
) > 0
AND hsr_v_homestore_assignment = 'ST'
OR ( ( locations_master.lnm_c_homestore_ind =
'Y'
AND (INSTR
(hsr_v_store_status,
locations_master.lnm_c_location_status
) > 0
AND hsr_v_homestore_assignment = 'HS'
);I have copied the explain as it is and can you please try pasting in the text pad.Can you let me know whether parallel hint on this will speed up the select queries.
Plan
INSERT STATEMENT CHOOSECost: 410,815 Bytes: 2,798,394 Cardinality: 15,395
32 UNION-ALL
15 SORT UNIQUE Cost: 177,626 Bytes: 2,105,592 Cardinality: 11,896
14 FILTER
13 HASH JOIN Cost: 177,312 Bytes: 2,105,592 Cardinality: 11,896
2 TABLE ACCESS BY INDEX ROWID LMHOLTP.LOCATIONS_MASTER Cost: 37 Bytes: 23,184 Cardinality: 966
1 INDEX RANGE SCAN NON-UNIQUE LMHOLTP.IX_LOCATIONS_MASTER_3 Cost: 3 Cardinality: 1
12 FILTER
11 HASH JOIN OUTER
8 MERGE JOIN CARTESIAN Cost: 155,948 Bytes: 702,656,660 Cardinality: 4,845,908
3 TABLE ACCESS FULL LMHOLTP.HOMESTORES Cost: 2 Bytes: 104 Cardinality: 1
7 BUFFER SORT Cost: 155,946 Bytes: 198,682,228 Cardinality: 4,845,908
6 PARTITION RANGE ITERATOR Partition #: 12
5 TABLE ACCESS BY LOCAL INDEX ROWID LMHOLTP.TRANSACTION_POINTS Cost: 155,946 Bytes: 198,682,228 Cardinality: 4,845,908 Partition #: 12
4 INDEX RANGE SCAN NON-UNIQUE LMHOLTP.IX_TRANSACTION_POINTS_1 Cost: 24,880 Cardinality: 6,978,108 Partition #: 12
10 PARTITION RANGE ALL Partition #: 15 Partitions accessed #1 - #5
9 TABLE ACCESS FULL LMHOLTP.ACCOUNT Cost: 6,928 Bytes: 68,495,680 Cardinality: 8,561,960 Partition #: 15 Partitions accessed #1 - #5
31 SORT UNIQUE Cost: 233,189 Bytes: 692,802 Cardinality: 3,499
30 FILTER
29 FILTER
28 NESTED LOOPS OUTER
24 HASH JOIN Cost: 226,088 Bytes: 664,810 Cardinality: 3,499
16 TABLE ACCESS FULL LMHOLTP.REWARD_OFFER_MASTER Cost: 8 Bytes: 2,280 Cardinality: 114
23 HASH JOIN Cost: 226,079 Bytes: 8,327,280 Cardinality: 48,984
20 TABLE ACCESS BY INDEX ROWID LMHOLTP.LOCATIONS_MASTER Cost: 37 Bytes: 432 Cardinality: 18
19 NESTED LOOPS Cost: 39 Bytes: 2,304 Cardinality: 18
17 TABLE ACCESS FULL LMHOLTP.HOMESTORES Cost: 2 Bytes: 104 Cardinality: 1
18 INDEX RANGE SCAN NON-UNIQUE LMHOLTP.IX_LOCATIONS_MASTER_3 Cost: 3 Cardinality: 966
22 PARTITION RANGE ITERATOR Partition #: 28
21 TABLE ACCESS FULL LMHOLTP.REDEMPTION_DETAILS Cost: 226,019 Bytes: 261,636,270 Cardinality: 6,229,435 Partition #: 28
27 PARTITION RANGE ITERATOR Partition #: 30
26 TABLE ACCESS BY LOCAL INDEX ROWID LMHOLTP.ACCOUNT Cost: 2 Bytes: 8 Cardinality: 1 Partition #: 30
25 INDEX UNIQUE SCAN UNIQUE LMHOLTP.CO_PK_ACCOUNT Cost: 1 Cardinality: 1 Partition #: 30 -
Could you please help me in writing query
Hi,
Data in table
ID -- H_squ -- D_squ --- Note
0001 1 1 he is
0001 1 2 coming
0001 1 3 from US
0001 2 2 he is going
0001 2 5 Back to US
0002 1 3 he took
0002 1 2 his laguage
0002 2 3 bi
output shouldbe
ID -- H_squ -- D_squ --- Note
<0001> <1> <1,2,3> <he is coming from US>
<0001> < 2 > <2,5> < he is going Back to US>
<0002> <1> <3,2> <he took his laguage>
<0002> <2> <3> <bi>
Actually I used STRAGG function But i am not getting expected output
group by ID, H_squ concat data order by D_squ column
Note should contain concat of D_squ(1,2,3) in this order
Could you please help me in writing queryThis forum is for issues related to Advanced Queuing.
Please only post in forums where your questions are appropriate. -
I have a macbook Pro i7 mid november 2010. I am wondering if i can exchange my notebook with the latest one. Can anyone help me out with this query please.
You can sell your existing computer using eBay, Craigslist or the venue of your choice. You could then use the proceeds to purchase a new computer.
-
Please help me in writing the SQL
Hi,
I am new to oracle.. Can you please help me in writing a SQL
I have a table which has the following columns
Start_date m1 ---- Start month of each quarter (Jan,Apr,Jul,oct)
end_date m3---- End month of each quarter
m1_start_date,
m1_end_date,
m2_start_date,
m2_end_date,
m3_start_date,
m3_end_date,
M1_act_rev,
m2_act_rev,
m3_act_rev
If a user selects the dates from Jan,2011 to Jun, 2011
I should get the aggregate of the revenues (m1+m2+m3+m1+m2+m3)Hi Gurus,
Will this work
select
b.DISTRICT_NAME,
count(c.CONTRACT_NUMBER),
sum(C.M1_ACT_REV),
sum(C.M2_ACT_REV),
sum(C.M3_ACT_REV),
sum(C.M1_EXP_PRICE),
sum(C.M2_EXP_PRICE),
sum(C.M3_EXP_PRICE)
from
clm_mn_compliance_data c,
CLM_MN_CUSTOMER_ALIGNMENT_DATA b
where
((m1_start_date between '01-01-2011' and '03-31-2011' ) and (m1_end_date between '01-01-2011' and '03-31-2011')) or
((m2_start_date between '01-01-2011' and '03-31-2011' ) and (m3_end_date between '01-01-2011' and '03-31-2011')) or
((m3_start_date between '01-01-2011' and '03-31-2011' ) and (m3_end_date between '01-01-2011' and '03-31-2011')) and
b.CUSTOMER_ID = C.CUST_CTRT_ID
group by
B.DISTRICT_NAME; -
My iPhone 6 ear speaker is not working properly I couldn't able to hear any thing from ear speaker to listen I had to put on loud speaker or to use hands free please help me out with this problem if some body have answer?
Hi Venkata from NZ,
If you are having an issue with the speaker on your iPhone, I would suggest that you troubleshoot using the steps in this article -
If you hear no sound or distorted sound from your iPhone, iPad, or iPod touch speaker - Apple Support
Thanks for using Apple Support Communities.
Best,
Brett L -
I have problem with account that i can't make update or buy from app store
There is massage appear in my payment page that i must contact with i tunes support to complete this transaction
Please help me to fixe this problem as soon possible
Hany hassan
0096597617317
0096596677186
Thank youYou need to Contact iTunes Support...
Apple Support iTunes Store Contact Us -
I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4
I have unabled 5 fingure gesture now not able to perform any task,also my power button is not working,please help me in removing this gesture,using I phone 4
Maybe you are looking for
-
PI message ID in mapping field
Hi experts, We have a requirement of generating a Uique number in ECC....since in PI, we have message id for every incoimg message which is UNIQUE , we need to pass the same messsage ID as a filed value in PI and map to one of the ECC field ...is it
-
I'm from united kingdom but iPhoto from america and postage, post code, how to change the country before i order them?...i need post code from untied kingdom, i don't know how to change from zip code(USA) into post code (UK)?
-
Can i watch videos from iphoto on my ipad?
can i watch videos from iphoto on my ipad?
-
Email kan niet in de prullenbak
Bij de ipad 1 geen problemen met de instelling, mail gaat gewoon in de prullenbak. Bij Ipad 2 krijg ik de melding bericht kan niet worden verplaatst. Opnieuw account al aangemaakt en opnieuw opgestart, maar er gebeurt niets.
-
[solved] exim complains about missing router driver "smtp"
Seeing the following error: paniclog wrote:2014-02-15 14:41:41 Exim configuration error in line 546 of /etc/mail/exim.conf: router gmail_relay: cannot find router driver "smtp" My configuration: exim.conf wrote: gmail_route: driver = manualroute