extraction of the number
Hello experts.
I am trying to extract figures below these model;
with t as
(
Select ' 6-27-40-12 W4M "as req_id, 1 as the id of the double."
Union of all the
Select "FERRIER - 10-24-41-9 W5M" as req_id, double id 2
Union of all the
Select 'M.D. '. Dunvegan - W6M 30-80-3 DON'T ' like req_id, 3 as the id of the double
Union of all the
Select "BELLSHILL LAKE - 5-21-41-12 W4M" as req_id, 4 as the id of the double
Union of all the
Select "County of LATHOM - W4M SW 20/10/17" as req_id, 5 as the id of the double
)
Select * from t;
Required result
ID req_id
1 6-27-40-12
2 10-24-41-9
3 30-80-3
4 5-21-41-12
5 20/10/17
Hello
user13328581 wrote:
Thank you all
Just quick question, there has been a change in needs. How to get the following results below instead
with t as
(
Select ' 6-27-40-12 W4M "as req_id, 1 as the id of the double."
Union of all the
Select "FERRIER - 10-24-41-9 W5M" as req_id, double id 2
Union of all the
Select 'M.D. '. Dunvegan - W6M 30-80-3 DON'T ' like req_id, 3 as the id of the double
Union of all the
Select "BELLSHILL LAKE - 5-21-41-12 W4M" as req_id, 4 as the id of the double
Union of all the
Select "County of LATHOM - W4M SW 20/10/17" as req_id, 5 as the id of the double
)
Select * from t;
the result below is obtained from the ID that matches models
(1) 9-9-9-9-W9M
(II) 9-9-9 with SW/SE/NW/NO
Required result
ID req_id
1 6-27-40-12 W4M
2 10-24-41-9 W5M
4 5-21-41-12 W4M
20/10/17 5, W4M
Sorry, I don't understand what you're saying about "W9M." I don't see this substring anywhere in the sample data.
Also, I don't understand what you want with "So/SE/NW/DON'T. Explain what exactly are the requirements.
Why don't you want to
ID REQ_ID_SUBSTR
--- --------------------------
3 30-80-3 W6M
in the output?
The following query gives the results you requested and the line above:
SELECT id
REGEXP_SUBSTR (req_id,
, '\d+(-\d+)*\s+\S+'
) AS req_id_substr
T
ORDER BY id
;
To exclude the row with id = 3, you probably need a WHERE clause.
Tags: Database
Similar Questions
-
How to extract the number and other particulars
I am trying to write a simple Select query that returns a list of
Used EMPLOYEE_TABLE and in the second column names a count of the
number of entries for each employee in the EMPLOYEE_ATTENDANCE table.
Can anyone suggest how I might do this?
For example:
I have two tables EMPLOYEE_TABLE and EMPLOYEE_ATTENDENCE.
EMPLOYEE_TABLE:
emp_number emp_name
1A
2B
3 C
4 D
EMPLOYEE_ATTENDENCE:
emp_number emp_time
1 8.00
1 8.00
1 8.00
4 8.00
4 9.00
4
4
4
3
3
3
2
Now my requirement is I want to retrieve the list of employees with emp_name and the number of days
the employee came (ie the number of entries in the EMPLOYEE_ATTENDENCE table).
Some, such as:
A 3
B 1
A q
D 5Select
a.emp_name, b.emp_attendence
Of
Employee_Name has,
(select emp_number, count (emp_number) "emp_attendence" of the employee_attendence by employee_number group) b
where a.emp_number = b.emp_number;Kind regards
Navneet -
Column data reading according to the number of lines
Hi guys,.
I am currently stuck on the problem of recovering the data from my database (MS Access) according to the number of lines, he has at any time (without having to know how many lines there will be during the programming of this part).
First, I show how my program works. I'm working on an automated food, order and after the customer has chosen his power, system information such as the name of the food, quantity and price of the food will be written to the MS Access database table. (for example table name "Orderingtable" in MS Access) For my case, 1 order of food will occupy 1 line of the database table. In other words, as part of the same, if he orders 3 different foods, 3 rows will be filled in my database table.
I would then get the part number of 'Quantity' for each order of the database and summarize the amount finally to count the total number of orders in the table of database at any time. This addition of result will be then shown on the Panel before informing the customer how many orders waiting's just prior to his order. In this case, it can get out if he wants to, if the number of orders is too big for its waiting time.
However, I do not know how many lines my 'Orderingtable' will be 'Orderingtable' because both accumulate lines and data lines until being command to remove. Therefore, I cannot predict how many lines I program the party totals the number of quantity for each line.
Is it possible that I can get the part of the 'quantity' without having to know the number of rows in the database so that I can count the total number of pending orders just by adding up the value of the quantity for each line?
I do not wish to "code" my program by limiting the tables of database for us are going to say, only 50 lines at any time.
Attached below, this is how my database table "Orderingtable" looks at, which will be used to extract the 'Quantity' column so that it can count the total number of orders and be shown/shown on the front panel of my Labview program.
I hope that you are able to help me!
Thank you so much in advance.
See you soon,.
MUI
You can also use the SUM function:
SELECT SUM (Quantity) OF the order WHERE Queue_No = %d
And no need of an "Order By" clause, if you add just the quantities.
-
time extraction of the digital signal
Hello
If I have digital signals from optical barriers and to extract the time (for a body that passes these 2 obstacles) how can I retrieve this day there using Labview.
THX
I have chata,
Thanks for the answer, and I hope that your well.
Here's an example I've done for a client, eager to discover the time of a flat section of its waveform.
In your case, you must make a detection of pic on both codes, then less locations and a few x with the number of the sample to get the time.
Let me know what you think.
Kind regards
James.
PS Sorry code is a bit hasty.
-
Install the Microsoft silverlight plug in. it's necessary to watch movies on my vista computer. When I try it is the message I get. Cannot find a volume with enough disk space for the file extraction. This is the message I get trying to watch a movie on netflix.
Hi cardsharkha,
I suggest you try the steps mentioned in the link below for cleaning broken Silverlight installation and check if the problem persists
How to manually clean a broken Silverlight installation
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:
How to back up and restore the registry in Windows
http://support.Microsoft.com/kb/322756/Thank you, and in what concerns:
Ajay K
Microsoft Answers Support Engineer
Visit our Microsoft answers feedback Forum and let us know what you think
-
Get the number of files in the folder
Hi all
How can we get the number of records present in the file, so that we can make the program to extract the different files in the folder according to the number?
Thanks in advance,
Sandeep
Check the FileConnection API and 'list' methods
-
get the number in the declaration of DBMS
Hello everyone,
my friend, I create the following code, but I've always faced a problem to display the result of County all the
the code is:
------------------------------
I insert a count (*) to get the number of employees
but he keep get only '1' to the last of the result in the following way:
DETAILS OF THE EMPLOYEE:
YJOSEPH5 | YOUSEFJOSEPH | 15 NOVEMBER 15
HYOUSEF10 | HASSANYOUSEF | 15 NOVEMBER 15
HYOUSEF17 | HASSANYOUSEF | 15 NOVEMBER 15
HYOUSEF14 | HASSANYOUSEF | 15 NOVEMBER 15
HYOUSEF16 | HASSANYOUSEF | 15 NOVEMBER 15
COUNT: 1
the code
------------------------------------
DECLARE
V_USER_ID VARCHAR2 (50);
NUMBER OF V_EMP_NO;
V_FIRST_NAME VARCHAR2 (30);
V_LAST_NAME VARCHAR2 (30);
DATE OF V_REG_DATE;
NUMBER OF V_COUNT;
V_SQL_SATEMENTS VARCHAR2 (1000);
NCOUNT THE NUMBER;
CURSOR C IS SELECT USER_ID, EMP_NO, FIRST_NAME, LAST_NAME, REG_DATE, COUNT (*) FROM EMP
USER_ID, FIRST_NAME, LAST_NAME, EMP_NO, REG_DATE GROUP;
BEGIN
OPEN C;
SELECT COUNT (*) FROM NCOUNT FROM USER_TABLES WHERE TABLE_NAME = 'EMP ';
IF (NCOUNT < = 0) THEN
V_SQL_SATEMENTS: =' CREATE TABLE EMP)
USER_ID VARCHAR2 (40) PRIMARY KEY,.
NUMBER OF EMP_NO,
FIRST NAME VARCHAR2 (30),
VARCHAR2 (30) LAST_NAME,.
DATE OF REG_DATE)';
RUN IMMEDIATELY "DROP TABLE EMP;
IMMEDIATELY RUN V_SQL_SATEMENTS;
END IF;SELECT NVL (MAX (EMP_NO), 0) + 1
IN V_EMP_NO
YOUSEF. EMP;
INSERT YOUSEF. EMP (USER_ID, EMP_NO, FIRST_NAME, LAST_NAME, REG_DATE)
VALUES (SUBSTR (: LAST NAME, 1, 1) |: LAST_NAME |) V_EMP_NO, V_EMP_NO,:FIRST_NAME,:LAST_NAME,TO_DATE(SYSDATE,'DD-MON-YY'));
DBMS_OUTPUT. PUT_LINE (' DETAILS OF THE EMPLOYEE: "");
LOOP
EXTRACT THE C IN V_USER_ID, V_EMP_NO, V_FIRST_NAME, V_LAST_NAME, V_REG_DATE, V_COUNT;
WHEN THE EXIT %C NOTFOUND;DBMS_OUTPUT. PUT_LINE (V_USER_ID |'|) ' || V_FIRST_NAME | V_LAST_NAME |' | ' || V_REG_DATE);
END LOOP;
DBMS_OUTPUT. PUT_LINE ("COUNT:" | "|") V_COUNT);CLOSE C;
END;
/ALL FRIENDS,
THANKS FOR EVERY BODY,
I JUST FOUND THE RIGHT WAY TO DO
FOR THOSE WHO WANT TO SEE:
-----------------------------------------------------------
DECLARE
V_USER_ID VARCHAR2 (50);
NUMBER OF V_EMP_NO;
V_FIRST_NAME VARCHAR2 (30);
V_LAST_NAME VARCHAR2 (30);
DATE OF V_REG_DATE;
NUMBER OF V_COUNT;
V_SQL_SATEMENTS VARCHAR2 (1000);
NCOUNT THE NUMBER;
CURSOR C IS SELECT USER_ID, FIRST_NAME, LAST_NAME, EMP_NO FROM EMP REG_DATE;
BEGIN
SELECT COUNT (*) IN THE EMP V_COUNT;
OPEN C;
SELECT COUNT (*) FROM NCOUNT FROM USER_TABLES WHERE TABLE_NAME = 'EMP ';
IF (NCOUNT<=0)>=0)>
V_SQL_SATEMENTS: =' CREATE TABLE EMP)
USER_ID VARCHAR2 (40) PRIMARY KEY,.
NUMBER OF EMP_NO,
FIRST NAME VARCHAR2 (30),
VARCHAR2 (30) LAST_NAME,.
DATE OF REG_DATE)';
RUN IMMEDIATELY "DROP TABLE EMP;
IMMEDIATELY RUN V_SQL_SATEMENTS;
END IF;SELECT NVL (MAX (EMP_NO), 0) + 1
IN V_EMP_NO
YOUSEF. EMP;
INSERT YOUSEF. EMP (USER_ID, EMP_NO, FIRST_NAME, LAST_NAME, REG_DATE)
VALUES (SUBSTR (: LAST NAME, 1, 1) |: LAST_NAME |) V_EMP_NO, V_EMP_NO,:FIRST_NAME,:LAST_NAME,TO_DATE(SYSDATE,'DD-MON-YY'));
DBMS_OUTPUT. PUT_LINE (' DETAILS OF THE EMPLOYEE: "");
LOOP
EXTRACT THE C IN V_USER_ID, V_EMP_NO, V_FIRST_NAME, V_LAST_NAME, V_REG_DATE;
WHEN THE EXIT %C NOTFOUND;DBMS_OUTPUT. PUT_LINE (V_USER_ID |'|) ' || V_FIRST_NAME | V_LAST_NAME |' | ' || V_REG_DATE);
END LOOP;
CLOSE C;
DBMS_OUTPUT. PUT_LINE ("COUNT:" | "|") V_COUNT);END;
/ -
Platform: Windows 7 x 64 database: Oracle Database Enterprise Edition Release 12.1.0.2.0 12 c - 64 bit.
How row_limiting_clause Oracle to rowcount. percent for HUNDRED lines works in Oracle 12 c?
Row_limiting_clause Oracle is acting funny. In the code below, the 'fetch_test' table has 10 rows
Case 1 When using row_limiting_clause with first extract 0.5 lines only I get, no line selected
Case 2 When use the row_limiting_clause with the first rows only 5 percent clause I get,1 row as output.
This means case 1! = 2 cases [0.5! = 0.5 (5 percent of 10 lines)]
SQL > select * from fetch_test;
COL1 COL2
---- ----
1A
2B
3 C
4 D
5 E
6 F
8: 00
5%
: j
10 J
10 selected lines.
case 1:
SQL > select col1 from fetch_test
2 first extract 0.5 lines only;
no selected line
case 2:
SQL > select col1 from fetch_test
2 extract the first rows of 5 percent;
COL1
----
1
1 selected line
What Oracle Documentation has to say,
https://docs.Oracle.com/database/121/SQLRF/statements_10002.htm
If the number of lines has a fraction, then the fractional part is truncated. If the number of rows is NULL, 0 rows are then returned.
This explains the case 1, but I can't find any possible explanation in case 2 in my example above. and there is no mention on percentage clause in the Oracle Documentation.
Already asked on stack - overflow.but I got the answer regarding "assumes percent Gets the cycle of 5% to 10%.
No idea why Oracle doing what they do on the documentation! I hope that now you have the answer: a rest (when you use percent in the line limiter) will ALWAYS return a number integer, rounded upward.
-
Dynamic calculation of the number of days between two dates in a table
Hello
I'm working on request where I dynamically calculate the number of days between two dates in a table.
The calculation must be dynamic, i.e., when I recover the Start_date and End_date and move to the field following (call_duration) in the same row, the difference must be calculated dynamically in this area and make sure the field read-only.
APEX version: 5.0
Hi BO123,
BO123 wrote:
Hello
I'm working on request where I dynamically calculate the number of days between two dates in a table.
The calculation must be dynamic, i.e., when I recover the Start_date and End_date and move to the field following (call_duration) in the same row, the difference must be calculated dynamically in this area and make sure the field read-only.
APEX version: 5.0
one of the way to do this by calling ajax on change of end_date.
See the sample code given below to fetch the resulting duration and making the field read only after calculation
Step 1: Change your page
under CSS-> Inline, put the code below
.row_item_disabled { cursor: default; opacity: 0.5; filter: alpha(opacity=50); pointer-events: none; }
Step 2: Create on demand Ajax process I say CALC_DURATION
Please check Procces Ajax, see line 6.7 How to assign a value to the variable sent by ajax call
Declare p_start_date date; p_end_date date; p_duration number; Begin p_start_date := to_date(apex_application.g_x01); p_end_date := to_date(apex_application.g_x02); --do your calculation and assign the output to the variable p_duration select p_end_date - p_start_date into p_duration from dual; -- return calculated duration sys.htp.p(p_duration); End;
Step 3: Create the javascript function
Change your page-> the function and the declaration of the Global Variable-> put the javascript function
You must extract the rowid in the first place, for which you want to set the time, see line 2
assuming f06, f07 and f08 is the id of the start date, and end date columns respectively, and duration
See no line no 8 how set the value returned by the process of ajax at the duration column
Replace your column to the respective column identifiers in the code below
function f_calulate_duration(pThis) { var row_id = pThis.id.substr(4); var start_date = $('#f06_'+row_id).val(); apex.server.process ( "CALC_DURATION", { x01: start_date,x02: $(pThis).val() }, { success: function( pData ) { // set duration to duration column $('#f08_'+row_id).val(pData); // disable duration column $("#f08_" + row_id).attr("readonly", true).addClass('row_item_disabled'); } }); }
Step 4: choose the end date call the javascript function
Go to report attributes-> edit your Date column end-> column-> Attrbiutes element attributes-> put the code below
onchange="javascript:f_calulate_duration(this);"
hope this helps you,
Kind regards
Jitendra
-
I can capture the number of records retrieved by page in the Apex Interactive report?
Hello
I have a requirement in which I need to conditionally hide / show button on an interactive report.
To achieve this, I need to compare the number of reows read by v/s lines page number to be
read as specified by the user (defined using Actions-> lines per page).
Please help me to know if there is a way to capture these 2 values:
1. number of records retrieved in a report by page
2. the value set by the user for the number of rows must be extracted (Actions--> lines per page).
Quick help is really appreciated. Thank you.
Hello
You can use by jariola in his blog
http://dbswh.webhop.NET/Apex/f?p=blog:read:0:article:41900346848694
Thank you
Benjamin
-
Friends of Hy. I want to ask that I am looking to get a pdf split software to split a pdf file into several PDF files with my set of pages specified. As if a document is 22 pages then I will specify the number of pages that must be cut in half in separate PDF files. for example I entered that do three pdfs of 1-5, 5-7, 8-10 pages and it will result in me
first pdf = 1-5 pages
second pdf = 5-7 pages
Third pdf = 8 to 10 pages.
Y at - there no way to do it with adobe acrobat or any other software? I tried many software including adobe with extract and split option, but I did not get the results you are looking for. so please:
I would like to know if any of you have any knowledge about it. I have
Thnanks in advance!
Hi minixain,
Yes, you can do it using Adobe Acrobat application (Adobe Acrobat free trial downloadversion |) Acrobat Pro DC), please refer to this document for help KB split a PDF | Adobe Acrobat DC tutorials.
Kind regards
Nicos
-
Hello
We use the foregoing infra of service Manager v9. We want to / have desgigned a template letter which, in theory, must extract all the data we want to leave a call connected and present in a merge document word (via the options of 'Letter' in the communication tab).
While we can call in various fields through the "Docvariable" function in Word 2010, some custom fields are more difficult to extract information from. i.e. drop down list fields, ext) when we use these commands like: docvariable EXTFLDV_500167------* MERGEFORMAT, get us a number 3-digit (its unique / about its position in another table), but we cannot get real the text value or string from the list / selected field itself.
We have tried to modify the .htm document used but are not sure of the exact commands that would convert / allow the actual value of the field to pass through, as opposed to a unique id.
There are indications - that someone might give us?
Thank you
You can run this query on the database to get the reference
SELECT PROFILE_REF FROM SU_FIELD WHERE REF = 500167
-
(1) I received an email like this:
Event_alert
2013-09-17 22:00:16 ERROR OGG - 01028 Oracle GoldenGate Capture for Oracle, ext_1.prm: object with the number of the object 80673 is compressed. Compression of the table is not supported.
2013-09-17 22:00:16 ERROR OGG - 01668 Oracle GoldenGate Capture for Oracle, ext_1.prm: PROCESS ABENDING.
(2) I have not found the OBJ
SQL > select OBJECT_ID, OBJECT_NAME from dba_objects where object_id = 80673;
no selected line
(3) change a few times the process EXT recover;
(4) my excerpt settings
Cat ext_1.prm
EXTRACT ext_1
Ogg, ogg PASSWORD USERID
TRANLOGOPTIONS EXCLUDEUSER ogg
SETENV (NLS_LANG = AMERICAN_AMERICA. ZHS16GBK)
-SETENV (NLS_LANG = AMERICAN_AMERICA. AL32UTF8)
EXTTRAIL ./dirdat/t1
DYNAMICRESOLUTION
TABLE YBK.*;
This is a bug that has been fixed
Excerpt from abending with Table of Compression is not supported, even if the database has no tables compressed. (Doc ID 1510691.1)
event text: Oracle GoldenGate Capture for Oracle, ext_1.prm: object with the number of the object 86173 is compressed. Compression of the table is not supported.
tableexclude *. DBMS_TABCOMP_TEMP *.
-
Gets the number of months to a Date
Hello
I use the version of database Oracle 11.2.1. I would like to calculate the number of fiscal month of a date.
For example:
Date: 31/03/2013
Fiscal No. month: 12
The fiscal year runs from 01 - Apr-31 - March each year.Hello
You can use
EXTRACT (MONTH FROM (ADD_MONTHS (mydate, -3)))
Example:
WITH mytable AS ( SELECT TRUNC(SYSDATE) - 400 + LEVEL mydate FROM DUAL CONNECT BY LEVEL <= 400) SELECT mydate, EXTRACT (MONTH FROM (ADD_MONTHS (mydate, -3))) fiscal_month FROM mytable WHERE mydate = TRUNC (mydate, 'MM') OR mydate = LAST_DAY(mydate); MYDATE FISCAL_MONTH --------- ------------ 31-MAR-12 12 01-APR-12 1 30-APR-12 1 01-MAY-12 2 31-MAY-12 2 01-JUN-12 3 30-JUN-12 3 01-JUL-12 4 31-JUL-12 4 01-AUG-12 5 31-AUG-12 5 01-SEP-12 6 30-SEP-12 6 01-OCT-12 7 31-OCT-12 7 01-NOV-12 8 30-NOV-12 8 01-DEC-12 9 31-DEC-12 9 01-JAN-13 10 31-JAN-13 10 01-FEB-13 11 28-FEB-13 11 01-MAR-13 12 31-MAR-13 12 01-APR-13 1
Kind regards.
Al -
Clusters and the number of vmotions
I have a DC with 6 groups of 8 guests each. Each cluster shows (481 to 770) hundreds of vmotions - and yet the DRS history shows no.
That is - that represent data and why it might be so different from what is in the history of the DRS?
Thank you
Don
I'm not sure what you mean by DRS history... the number of vMotions is a value supplied by the API level of the cluster that is extracted from the leaves here - http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.ClusterComputeResource.Summary.html
It must match the number of migrations that you see in the summary page of your cluster
I strongly recommend that take you a look at this page on how to get started with the vSphere SDK for Perl - http://www.virtuallyghetto.com/2010/05/getting-started-with-vsphere-sdk-for.html
Maybe you are looking for
-
MainStage 3.2.3 CPU problem unsolved
Please see the video: https://youtu.be/_cpVa64tmrY cpu problem in the mainstage 3.2.3 the video has been used in the same concert, perform the same functions, the difference is absurd.
-
How to prune the list of AutoComplete?
My list of AutoComplete became unwieldy and needs to be cut. How can I do this?
-
Problems to reformat my Dell XPS 710 desktop computer.
I have a Dell XPS 710 desktop computer and I'm trying to reformat my computer. I tried pressing F8 at startup and do a repair, and I get an error Unmountable_boot. If I start the computer and press F12, the hard drive does not work with my drive. Is
-
Explorer Windows has stopped working when I click on the start icon
Gud afternoon, I have 2 problems. 1 problem is inCD.exe (which i already clear it but sure my window stopped Explorer working Isit because of this problem stop does not work) 2nd problem is whenever I click on the icon start at the bottom left and ri
-
Why Media Player does not work when my webcam is installed?
Everything has been working great until this evening. When I try to play a song, I get the error message that windows media player has encountered an error - relatives or wbhelp - and when you select web help, I was directed to the My Device Manager,