SQL> create table customer( 2 customer_ID number(3) primary key, 3 customer_Name varchar2(26), 4 contact_Name varchar2(26), 5 phone number(10)); Table created. SQL> desc customer …
Firebird query taking too long when using IN clause with Stored Procedure
For a report I had to write a recursive Stored Procedure GET_RECIPE_STEPS_ID(recipe_id). It returns ids of steps which are of type recipe. I.E. SELECT GET_RECIPE_STEPS_ID.ID FROM GET_RECIPE_STEPS_ID(…
SQL: CROSS JOIN over table partitions
I have the following table session_id | page_viewed 1 | A 1 | B 1 | C 2 | B 2 | E What I would like to do is a cross join of the …
How to substract Table1 values from Table2?
Table1 contains ColumnA, Table2 contains ColumnA and ColumnB. How do I remove(delete) rows in Table2 that contain ColumnA values in both tables?
How to merge two rows having same data?
i have a table with some data i want to merge the identical row i.e.as shown in image two identical rows having same tDateWorked,empid,jobid i want to merge this records so that OT and ST should …
Range based window Frame can have only 1 sort key
Ive tried to run the next query select sum(balance) over (partition by client order by card desc, date_tr desc) from table_1 And in Result i have the next error message: FAILED: SemanticException …
Is there a better way to simplify many nested select statements?
I am worried that I think about SQL wrongly. I am able to hack queries together to do what I want, but they end up quite ludicrous with multiple nested selects. Here is an example that I can’t fathom …
Extract only dates for first Day of Month from a daily Date Dimension Table without nesting
I am using SQL Server 2014 and I have the following T-SQL query which retrieves the dates of the first day of each month (based on my filters) from a Date Dimension Table: SELECT * FROM ( SELECT …
Select column as true / false if the keypair exists in another table
I have currently these tables. Server: MariaDB (I removed some columns to make it more simple) Person table: id | username | password ——————————————-…
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…