need help to get the desired outcome of the sql query
Hi all
I have column values that are separated by space as query below.
Select "exadata apex oracle12c java obiee.
From Dual;
I need to get the result in the new line for every 2 ^ space N th of a column values. Please see the below expected o/p.
Expected results:
-------------------------
Exadata apex
java oracle12c
OBIEE
Hello
REGEXP_SUBSTR is a way:
WITH got_str AS
(
SELECT "exadata apex oracle12c java obiee" STR
OF the double
)
SELECT LEVEL AS m
REGEXP_SUBSTR (str,
, '\S+(\s+\S+)?'
-P
LEVEL
) AS sub_str
OF got_str
CONNECT BY LEVEL<= regexp_count="" (str,="">=>
;
Output:
M SUB_STR
---------- ---------------------------------
1 exadata apex
2 java oracle12c
3 obiee
'\s' means any white space character (including spaces, tabs, and line breaks), and \S means any character except whitespace.
If you want only the space character ("") is the separator and have tabs and line breaks in the delimited words, then use
"" instead of "\s" and
"[^]" rather than "\S".
Tags: Database
Similar Questions
-
Need help to build the SQL query
Hi all
I struggle to create the select statement.
This is my expected outcome:
Insert into tmp (aa, bb, cc, dd)
values('CUST1','10100001',2,'10-Jan-2013');
Insert into tmp (aa, bb, cc, dd)
values('CUST1','10100002',4,'11-Jan-2013');
Insert into tmp (aa, bb, cc, dd)
values('CUST2','10200001',2,'19-Jan-2013');
Insert into tmp (aa, bb, cc, dd)
values('CUST2','10200002',6,'28-Jan-2013');
Insert into tmp (aa, bb, cc, dd)
values('CUST2','10200003',1,'28-Mar-2013');
My result is:
AA COUNT (1) MAX (DD) by cc dd AA AA
CUST1 2 10100002 4 11 January 2013
CUST2 3 10200003 1 28 MARCH 2013
Can someone help with the select statement?
Thank you and best regards,
Iwan
Just change it to the column:
SELECT
AA
COUNT (aa)
, MAX (bb) keep (last dense_rank command by JJ)
, MAX (cc) keep (last dense_rank command by JJ)
MAX (dd)
OF THE TMP
GROUP BY aa
ORDER BY aa
Note that by default sort order is ascending with the last NULL values.
If in case your line-date-max will contain null value in the bb or cc columns those will be returned.
Post edited by: Correction of chris227
Post edited by: chris227 added note
-
Need help to write the SQL query
Hello
Please help me to write a query. My requirement is as below.
Hello
I have a table say XYZ in the following format.
product_id local min_order_quntity
========================================
1 en 10
1 ch 10
2 en 20
2 ch 20
3 en 30
3 ch 30
4 en 40
4 NC 10
Now I want to find the product_id where min_order_quantity is different for cn and locale
now I want the result of the following
product_id local min_order_quantity
=============================================
4 en 40
4 ch 10
This is different for local in and cn for product_id 4 min_order_quantity
min_order_quantity should be the same for both the locale(en,ch) for any product_id.
I want to find the product_id where min_order_quantity is different for ch and fr local
Thank you..Hello
This query should do the job
select * from xyz t1 where exists ( select 1 from xyz t2 where t2.product_id = t1.product_id and t2.locale != t1.locale and t2.min_order_quantity != t1.min_order_quantity );
See you soon
-
Hi, I need help, I get the error message "Download error, Undefined" in the applications tab to install Apps. Can someone help?
Follow the procedure below and check:
End Adobe partner all tasks in the Manager of tasks like creative cloud, CoreSync, AAMUpdater... etc.
Uninstall Adobe Creative Cloud application.
If you face any problem try CC Uninstaller:
Using creative cloud | Uninstall the creative cloud desktop application
After removing Adobe Creative Cloud applications, follow these steps:
Step 1:
Open the c: drive and navigate to C:\Program Files (x 86)------\Adobe " common files".
Open the Adobe folder and delete folders named Adobe Application Manager and OOBE.
Step 2:
Navigate to C:\Program Files (x 86) \Adobe.
Open Adobe file and if present the file to remove Adobe Creative Cloud . [* important]
Impossible to remove?
Rename it as Adobe Creative Cloud-old.
Step 3:
Press Windows button (located between Ctrl and Alt buttons) with the key R together at once, you will get a command window.
Type below command and press the enter"" key.
AppData
Then go to the Local > Adobe.
Open the Adobe folder and delete folders named AAMUpdater and OOBE.
Step 4:
Temporarily disable anti-virus and firewall.
(1) open Control Panel and then click on the network and Internet"" option.
2) click on Internet options, click on the tab "connections".
(3) in the 'Connections' tab, select 'LAN' settings, you will be able to view the LAN settings box.
(4) check the box-"automatically detect settings" and then "uncheck" all the other boxes as "configuration Script auto use", "Use a proxy server," proxy server ", then click on the ok button."
5) click on the "Network settings" button once again, make sure that "Automatically detect settings" is the only option you select, the window of properties of LAN so clear.
Step 5:
Make sure that Adobe Creative Cloud is not listed in the control panel > programs and features. list.
Then, download and install the Adobe Creative Cloud app and check.
https://ccmdls.adobe.com/AdobeProducts/KCCC/1/Win32/CreativeCloudSet-up.exe
-
How to get the SQL query running of af: search?
I use JDeveloper 11.1.2.3.0. I have a page where I've set up an af:query and an array of result. The problem is that I can't get the exact query that is used during the execution of this component in a managed bean method. Is it possible to get the query string that is run within the af: query?
Thank you
Hello
Method of the ViewObject getQuery() returns what you need;
You can replace the executeQueryForCollection(), and prior to calling super, you can print the result of getQuery() method:
public void executeQueryForCollection (rowset Object,
Object [] params,
{int noUserParams)
System.out.println ("SQL =" + getQuery());
call the super method here...
}
-
Need help to get the right start!
Hello
I have 'given', back to January 1 of this year so far. I am looking for a way to get this info easily and my final result, will be a monthly comparison of the way in which all of my products (9 items) Farouk against each other.
My products are:
Plan A - 3 Plans - 1 month subscription $11.00
-6 month subscription $16.00
-12 month subscription $21.00
Plan B - 3 Plans - 1 month membership $10.00
-6 month subscription $15.00
-12 months membership $ 20.00
Plan C - 3 Plans - 1 month subscription $9.99
-6 month subscription $19.99
-12 month subscription $29.99
I'm only interested in the amounts that each plan has generated in a month. I have no need of a customer Base. Since I'm on a new learning curve, my biggest fear is that I begin my quest to wrong-foot! If anyone can help me get started, it would be greatly appreciated...
Thanks again
Ron
Please post an example of data by copying and pasting the table in this forum. Please remove sensitive, personal or professional information.
-
Hello everyone, I really need someone who could help me get an image file (ROM or BIN) bios for my laptop HP dv6-7204AX ENVY.
For some reason, after that cleaning my fan cpu and everything put back toghether I had accidentally damaged the bios, because the electric sock, that's what the tech guy said :-(
My computer is now automatically power on whenever I plug the adapter and nothing start (only caps lock led flashing continuously1time and black screen)
Thank you
Hello kieuminhuy... I'm sorry that you are having this problem with your ENVY dv6!
kieuminhuy, you can go to the page of downlopad 7200 WANT dv6 to download and run the SoftPAQ BIOS proper. You do not have to run this SoftPAQ on the failed system - it should work on any system! When you run the SoftPAQ, chose the option to copy the image file of the BIOS to another location (see below).
I hope this helps!
WARNING: I am an employee of HP, but I am not a spokesman for HP.
- If you found this information useful, please take a moment to click on "accept as a Solution.
- If you do not want to say thank you, please click the 'thumbs up' to give me congratulations!
-
Need help to get the system restored after Trojan virus. does not work in safe mode
We were running without anti-virus software. System started running very slow and wouldn't normally. He has started in Mode safe has finally got and ran Malwarebytes detected 2 Trojan virus. Those removed, installed Norton in safe mode, but can not get computer to open in normal mode for the comprehensive analysis of norton and difficulty. Help!
The only way to be sure you are free of malware is to format and start over.
If you have a backup from before the problem you can restore.
If not and you have the win 7 dvd you can re - install.
'
If not and you have a factory restore partition, you can restore from that.If this isn't a clean install. You will need a win 7 dvd and number series.
-
need help to get the account for at least 11 months on my analysis
Hi all
I'm working on an analysis in which I need to get the number of children for a year where children must be at least 11 months in a given year. In my case in the database for each year, the number is 1 to 12. I don't know if there are atleast function or do I have to write an expression, if so please let me know where to write the expression is on the extent or the filter? I am totally new to the tool, and the version is OBIEE 11 g. Your help is greatly appreciated.
Thank you
RaviJust put a filter on the count > = 11
-
Need help to get the actual execution plan
I need to get the actual execution plan of a query and its actual cost.
If I understand correctly explaining the plan gives only the estimated according to my plan. Can someone help me please?I'm doing this:
SQL> select OBJECT_NAME,DATA_OBJECT_ID,STATUS from dba_objects where owner='SANTU'; OBJECT_NAME DATA_OBJECT_ID STATUS -------------------------------------------------------------------------------- ------------------------------------------------ -------------- ------- TST_REDEF 73444 VALID REDEF_PK 73447 VALID SQL> select sql_id,sql_text from v$sqlarea where sql_text like '%DATA_OBJECT_ID,STATUS from dba_objects%'; SQL_ID ------------- SQL_TEXT -------------------------------------------------------------------------------- gbvnfhs59t98f select sql_id,sql_text from v$sqlarea where sql_text like '%DATA_OBJECT_ID,STATUS from dba_objects%' bxdyf6ph2g3ay select OBJECT_NAME,DATA_OBJECT_ID,STATUS from dba_objects where owner='SANTU' SQL> select * from table(dbms_xplan.display_cursor('bxdyf6ph2g3ay')); PLAN_TABLE_OUTPUT -------------------------------------------------------------------------------- SQL_ID bxdyf6ph2g3ay, child number 0 ------------------------------------- select OBJECT_NAME,DATA_OBJECT_ID,STATUS from dba_objects where owner='SANTU' Plan hash value: 2160718650 ------------------------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | | | 47 (100)| | | 1 | VIEW | DBA_OBJECTS | 1638 | 161K| 47 (3)| 00:00:01 | | 2 | UNION-ALL | | | | | | |* 3 | FILTER | | | | | | |* 4 | HASH JOIN | | 1830 | 209K| 46 (3)| 00:00:01 | | 5 | INDEX FULL SCAN | I_USER2 | 88 | 1936 | 1 (0)| 00:00:01 | | 6 | NESTED LOOPS | | 1830 | 169K| 45 (3)| 00:00:01 | | 7 | TABLE ACCESS BY INDEX ROWID| USER$ | 1 | 18 | 1 (0)| 00:00:01 | |* 8 | INDEX UNIQUE SCAN | I_USER1 | 1 | | 0 (0)| | |* 9 | TABLE ACCESS FULL | OBJ$ | 1830 | 137K| 44 (3)| 00:00:01 | |* 10 | TABLE ACCESS BY INDEX ROWID | IND$ | 1 | 8 | 2 (0)| 00:00:01 | |* 11 | INDEX UNIQUE SCAN | I_IND1 | 1 | | 1 (0)| 00:00:01 | | 12 | NESTED LOOPS | | 1 | 29 | 2 (0)| 00:00:01 | |* 13 | INDEX FULL SCAN | I_USER2 | 1 | 20 | 1 (0)| 00:00:01 | |* 14 | INDEX RANGE SCAN | I_OBJ4 | 1 | 9 | 1 (0)| 00:00:01 | | 15 | NESTED LOOPS | | 1 | 97 | 1 (0)| 00:00:01 | | 16 | TABLE ACCESS BY INDEX ROWID | USER$ | 1 | 18 | 1 (0)| 00:00:01 | |* 17 | INDEX UNIQUE SCAN | I_USER1 | 1 | | 0 (0)| | |* 18 | INDEX RANGE SCAN | I_LINK1 | 1 | 79 | 0 (0)| | ------------------------------------------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- 3 - filter(((("O"."TYPE#"<>1 AND "O"."TYPE#"<>10) OR ("O"."TYPE#"=1 AND =1)) AND (("O"."TYPE#"<>4 AND "O"."TYPE#"<>5 AND "O"."TYPE#"<>7 AND "O"."TYPE#"<>8 AND "O"."TYPE#"<>9 AND "O"."TYPE#"<>10 AND "O"."TYPE#"<>11 AND "O"."TYPE#"<>12 AND "O"."TYPE#"<>13 AND "O"."TYPE#"<>14 AND "O"."TYPE#"<>22 AND "O"."TYPE#"<>87 AND "O"."TYPE#"<>88) OR BITAND("U"."SPARE1",16)=0 OR (INTERNAL_FUNCTION("O"."TYPE#") AND ((SYS_CONTEXT('userenv','current_edition_name')='ORA$BASE' AND "U"."TYPE#"<>2) OR ("U"."TYPE#"=2 AND "U"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv','current_edition_id'))) OR IS NOT NULL))))) 4 - access("O"."OWNER#"="U"."USER#") 8 - access("U"."NAME"='SANTU') 9 - filter(("O"."NAME"<>'_NEXT_OBJECT' AND "O"."NAME"<>'_default_auditing_opt ions_' AND "O"."LINKNAME" IS NULL AND BITAND("O"."FLAGS",128)=0 AND "O"." SPARE3"="U"."USER#")) 10 - filter(("I"."TYPE#"=1 OR "I"."TYPE#"=2 OR "I"."TYPE#"=3 OR "I"."TYPE#"=4 OR "I"."TYPE#"=6 OR "I"."TYPE#"=7 OR "I"."TYPE#"=9)) 11 - access("I"."OBJ#"=:B1) 13 - access("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv',' current_ edition_id'))) filter(("U2"."TYPE#"=2 AND "U2"."SPARE2"=TO_NUMBER(SYS_CONTEXT('userenv', 'current _edition_id')))) 14 - access("O2"."DATAOBJ#"=:B1 AND "O2"."TYPE#"=88 AND "O2"."OWNER#"="U2"."US ER#") 17 - access("U"."NAME"='SANTU') 18 - access("L"."OWNER#"="U"."USER#") 57 rows selected. SQL>
Kind regards
S.K. -
Need help to get the serial number
I bought Photoshop Elements and first items grouped in version 8. I've updated both to version 10, two years ago but I have apparently lost the serial numbers for v10. The number of items in the Prime Minister appears in my account, but not Photoshop elements. I need to know what my current Photoshop Elements serial number is so I can upgrade. Can someone please help me find how to do this? Thank you
To the link below, click on the still need help? the option in the blue box below and choose the option to chat...
Serial number and activation support (non - CC) chat
http://helpx.Adobe.com/x-productkb/global/Service1.html ( http://adobe.ly/1aYjbSC ) -
Need help to get the index in activeHistoryState
Hello
I would like to get the current index of activeHistoryState via JavaScript.
For example, I have a length of historyStates of 15 years and as a user, I put the activeHistoryState at index 12.
The number 12 is the clue that I would like to ask the PS via JavaScript.
I searched through "documentation and could not find."
Is it possible to do?
Your help is very appreciated.
The Photoshop object model is not the necessary properties to determine the State of the assets of history. But it can be determined using the action Manager.
function getActiveHistoryStateIndex(){ var ref = new ActionReference(); ref.putProperty( charIDToTypeID( 'HstS' ), charIDToTypeID( 'CrnH' ) ); return executeActionGet(ref).getInteger( charIDToTypeID( 'ItmI' ) ); };
-
How to get the sql query result?
Hello
Currently I use LV2012 to connect to an Oracle database server. After the Oracle Express and Oracle ODBC driver facilities/settings made.
I managed to use the SQL command to query the data through my command prompt window.
Now the problem is, how to do the same task in Labview using database connectivity tools?
I have build a VI to query as being attached, but I have no idea of what range to use to get the result of the query.
Please help me ~ ~
Here is a piece of code that I use to test the SQL commands, you can use the part that retrieves the results of sql.
It is also possible to get the rear column headers, but it's for the next lesson!
;-)
-
need help to get the desired outcome of the SQL using REGEXP_REPLACE
Hi all
I have following query column values.
Select (1-4, 8-9, 7, 11-13') twice;
Here, I need to replace the '-' in the sequence number, as shown in the below expected o/p.
Expected results
-------------------------
1,2,3,4,8,9,7,11,12,13
Hello
dbaKrish wrote:
Hi all
I have following query column values.
Select (1-4, 8-9, 7, 11-13') twice;
Here, I need to replace the '-' in the sequence number, as shown in the below expected o/p.
Expected results
-------------------------
1,2,3,4,8,9,7,11,12,13
Its one-way:
WITH got_str AS
(
SELECT ' 1-4, 8-9, 7, 11-13' STR
OF the double
)
got_comma_delimited_parts AS
(
SELECT LEVEL AS part_num
REGEXP_SUBSTR (str,
, '[^,]+'
1
LEVEL
) IN the framework
OF got_str
CONNECT BY LEVEL<= regexp_count="" (="">=>
, '[^,]+'
)
)
got_nums AS
(
SELECT part_num
TO_NUMBER (REGEXP_SUBSTR (part
, '\d+'
)
) AS low_num
TO_NUMBER (REGEXP_SUBSTR (part
, '\d+$'
)
) AS high_num
OF got_comma_delimited_parts
)
got_max_range AS
(
SELECT MAX (high_num - low_num) AS max_range
OF got_nums
)
AS cntr
(
SELECT the LEVEL - 1 AS n
OF got_max_range
CONNECT BY LEVEL<= max_range="" +="">=>
)
SELECT (n.low_num + c.n LISTAGG
, ','
) (ORDER BY n.part_num group
, c.n
), Exit
OF got_nums n
CNTR JOIN c ON c.n<= n.high_num="" -="">=>
ORDER BY part_num
;
This assumes that each part separated by commas composed entirely unsigned integerss, or exactly 2 integers separated by a hyphen and the integer before the dash is not that the whole greateer after the hyphen. If you can not be sure of these things, you will need to change the query slightly to check and handle exceptions.
-
Need help to get the newspaper Windows installed in Windows 7?
Original title: will windows XP Tablet PC edition 2005 Recognizer Pack Windows run on win 7?
I was running Windows Journal on a Toshiba Tablet pc. My new computer is a Fujitsu with Win 7 OS. Y at - it can I get Win Journal and install it on the Fujitsu?
TSC_52Hello
Looks like Windows Journal is compatible with windows 7, for more information click on the link of compatibility of windows 7:
Windows 7 Compatibility Center
http://www.Microsoft.com/Windows/compatibility/Windows-7/en-us/default.aspx
You can run the Windows log on windows 7 in compatibility mode and:
Run the program compatibility Wizard
a. open the Compatibility Assistant programs by clicking the Start button, click Control Panel, clicking programs, and then clicking use an older with this version of Windows program.
b. follow the instructions in the wizard.
Make older programs in this version of Windows
http://Windows.Microsoft.com/en-us/Windows7/make-older-programs-run-in-this-version-of-Windows
Let us know if it helps.
Maybe you are looking for
-
External speakers are not not in his list of output
I have a set of speakers Sony SRS bluetooth - X 3 which I use with a Macbook pro running El Capitan 10.11.5 Recently, I was unable to use them because they no longer appear in the list of OUTPUT in the sound preferences. The device is connected and a
-
What is ltmsg.exe 7 in my windows XP? Do I need? Can I disable it?
-
As recommended, I generated a "userkey.psw" for my laptop Compaq W7/64. Now, the file is stored in the root of a USB key. The problem is that I was not able to find out in what circumstances it is used and how to go about its use.
-
Windows Update does not move forward
My computer did an automatic update and does not precede past "Configuration step 3 of 3". The computer then stops off the coast and after several minutes restarts and repeats the same sequence, "step 3 of 3" update configuration.
-
Had a blue screen and "Spooler SubSystem App stopped working.
"Spooler SubSystem App stopped working and was closed" appears whenever I turned on my laptop for a week. Also, a message appeared twice telling me: blue screen problem event name. I don't know what it means all the