We are using an ERP system, here is one sql query below – and it’s working: (it’s using an old syntax) (select last_name||’ ‘||name||’ ‘||to_char(datum_p,’DD.MM.YYYY’) from ( select co….
Tag: oracle
Oracle not auto-generating primary key on insert
New to Oracle here. I have a table created with the following SQL: create table Widgets ( id integer constraint pkWidgets primary key using index, ruleId integer not …
Identify a column where data has been entered multi line
Oracle Database 11g Enterprise 11.2.0.4.0, PL/SQL Release 11.2.0.4.0 I have a Table, which contains an address column (NVARCHAR2(50)). This column is supposed to be line 1 of the address only. There …
Execution from the statement select * into return error
Can somebody help me? I am try execute the command below in Oracle 11 and I get this error: SQL Error [905] [42000]: ORA-00905: keyword not found. Code: I read the Oracle docs and haven’t found any obvious error in my statement. https://docs.oracle.com/cd/B19306_01/appdev.102/b14261/selectinto_statement…
Hierarchical Data In Oracle SQL
I have tbl_parent like this in Oracle SQL, sample data is given below: Id(primary key) parentid childid 1 1 2 2 1 3 3 2 …
Oracle: Analytical functions Sub totals after each change in value
I have the following data (order of records as in the example): A B 1 10 1 20 1 30 1 40 2 50 2 65 2 75 1 89 1 100 from SQL: with x as ( select A, B from ( select 1 as A, …
count of nulls over a window
I need to get the count of nulls group by ID but excluding the month and sales in group by sample data id custname reportdate sales 1 xx 31-JAN-17 1256 1 xx …
SQL : select the oldest record for each distinct element
I apologize for the poor worded title, let me illustrate first Here is the table : select task_id, task_status, date_change, username from logs order by task_id, date_change Results : TASK_ID …
Why I’m getting ORA-00979 while trying to use LISTAGG and LEFT JOIN?
I’m trying to group my results so, instead of looking like this: id | nome | bairro ——————— 1 . |Test 1 | bairro 1 1 . |Test 1 | bairro 2 2 . |Test 2 | bairro 3 It looks like this: …
Group By clause changes the results
I have a query like SELECT weeks_ind, weeks_rol, weeks_no, date, CASE WHEN SUM(CASE WHEN rec = ‘Y’ THEN 1 ELSE 0 END) >= 1 THEN ‘Y’ ELSE ‘N’ END “rec”, CASE WHEN (SUM( CASE WHEN glob is null …