Skip to content

Tag: oracle

SQL query to classify triangles into Equilateral, Isosceles, etc

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…

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

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