How can i get the duplicate value in oracle -
Hello, I have selected the following columns using different tables using the left join and I am getting the following results.
Box_ID BOX_NAME VALUE PROM_EFFDATE PROM_CLOSEDATE 11JE1 115 2/27/2014 11JE280/2/27/2014 3/6/2014 11JE460 2/17/2014 11JE3 If PROM_CLOSEDATE has some value, then Equal BOX_NAME (JE2) should be shown again with zero value and null fluctuation. For different periodic time, Can enter This should be a real requirement result:
box_id BOX_NAME VALUE PROM_EFFDATE PROM_CLOSEDATE 11JE1 115 2/27/2014 11JE280/2/27/2014 3/6/2014 11JE2 11 Like I have to get the price like JE4 60 2/17/2014 11JE3
Here I have used San's according to the guidance, tab union select box_id, BOX_NAME, NULL, NULL, SELECT Box_ID, BOX_NAME, VALUE, PROM_EFFDATE, PROM_CLOSEDATE NULL FROM tab WHERE PROM_CLOSEDATE is not ordered by 2 but I want results with more precise when I enter the value and effective date (without CLOSE_DATE) for the JE2 (second) function I am getting the following output at that time. Box_ID BOX_NAME VALUE PROM_EFFDATE PROM_CLOSEDATE 11JE1 115 2 / 27/2014 11JE280 2/27/2014 3/6/2014 11JE 2 90 4/6/2014 11JE2 11 JE4 60 2/17/2014 11 JE3
But in reality, I do not need to record with empty value, zero effective date, zero shotgun when BOX_NAME (here JE2) There is no clause for me only if I need to tap it with the closet in its record. Even this value is not recorded with the effective date and no closing, the blank record should not come. This is my requirement Please help me to get the answers.
The easiest way is to use the union <(> 11, 'je 1' 115, '2/27/2014', all selected from Dual Union 11, with the choice of '' JE2 '' (Box_ID, BOX_NAME, VALUE, PROM_EFFDATE, PROM_CLOSEDATE) with pre-> , all selection of Dual Union 11 , 'JE2', 90, '2/28/2014', '3/7/2014', 80 from Dual Union, '2/27/2014', '3/6/2014' Everyone's Selection 11 , 'JE4', 60, '2/17/2014', All Select from Dual Union 11, 'JE3', Zero, Zero, Dual by Faucet) ---------- - Data Preparation End of ---------- SELECT Box_ID, BOX_NAME, VALUE, PROM_EFFDATE, PROM_CLOSEDATE to Tab Eun Aviation select Box_ID, BOX_NAME, NULL, NULL, NULL FROM tab is not null order by WHERE PROM_CLOSEDATE 2 Output:
| BOX_ID | BOX_NAME | VALUE PROM_EFFDATE | PROM_CLOSEDATE | | -------- | ---------- | -------- | -------------- | ----- ----------- | | 11 | Je 1 115 | 2/27/2014 | (Faucet) | | 11 | Je 2 80 | 2/27/2014 | 3/6/2014 | | 11 | Je 2 (Faucet) | (Faucet) | (Faucet) | | 11 | Je 3 (Faucet) | (Faucet) | (Faucet) | | 11 | Je 4 60 | 2/17/2014 | (Faucet) |
Comments
Post a Comment