Please tell me what is wrong in this code? I’m getting “ERROR at line 2: ORA-00907: missing right parenthesis” for the following snippet. Please help me out. Answer Keep in mind that CASE statements are evaluated IN ORDER – the first WHEN clause that fits “wins” and no furt…
Tag: oracle
(SQL) How do I differentiate 2 columns from different tables with the same name when selecting?
I’m using an Oracle 12c SQL server. The goal is to create a view containing each company and the drugs it produces. How can I differentiate two columns with the exact same name but located in …
Is there a way to execute an SQL merge atomically?
I am looking for a way to connect a tuple of values with a random UUID in a non-locking manner and without the potential to fail a transaction due to concurrency constraints. The table I need to …
sql query to fetch exchange rate
Given a sales table with sales amount stored in local currencies and an exchange rate table containing currency conversion rate, to get total sales amount in USD for each sales date I need query Sales Table: Exchange Rate Table: have no idea how I should proceed I have to do two things match the currency and …
Max Value based on two columns
I have a table with multiple columns that contains both month and year. I’m trying to identify based on column1,column2 what is the greatest month and year. I have a DDL for a test table as such. This is the data in the example table. I want to get the record with the max month and year. When I attempt
Can’t commit changes to table with Datagrip
I use Datagrip 2016.3. When I try to alter a value in a table, I can’t commit that to the database (a Oracle SQL-DB). What did I do: – Setting a cell to /some new value – Pressing the checkmark icon (…
Find name of manager with max number of subordinates
I need to write SQL query (for Oracle) which displays name of manager with max number of subordinates. Table’s structure: MGR_ID employees’ attribute is an EMPNO(primary key) of manager. What I’ve tried so far: Answer Another version suggested by a_horse_with_no_name PS : Query Not Tested
Count on case Oracle
WE have below data in oracle database – I want count on column two in such a way that – Ouput – Best Regards Answer Thanks Guys. But I could do this way – Thanks for your replies
how to select a list of 10,000 unique ids from dual in oracle SQL
So I can’t create or edit tables (I’m a user with read only permission) and I want to look up 10,000 unique id’s. I can’t put them inside of an IN() statement because oracle limits over 1000 items. Is it possible to select this entire list from the DUAL table in oracle? Something like:…
Table shows DISTINCT information when I tell it not to?
For some reason I keep getting an output with DISTINCT information. I am trying to understand JOINS and I am not sure why I am getting this output: MANUFACTURE MODEL …