For my assignment, we have to return the count of students that are below the average of the average where students are in section_id 86 and the grade_type_code is ‘FI’ I feel like I have it structured right because I’m able to return all the results just I can not figure out how to have the…
Tag: oracle
How to solve this error – ORA-22818: subquery expressions not allowed?
But it shows an error: subquery expressions not allowed here Do you know how to solve the error? Answer LEFT JOIN a derived table (aka inline view) that returns each department’s min and max salary:
logic to create more rows in sql
I have a table1 that I wanted to transform into the expected table. Expected table logic for columns: cal: comes from cal of table1. ID comes from the ID of table1. code: this is populated with lp or fp depending upon if we have a value in f_a then we create a new record with fp as code. corresponding to
Custom sorting in oracle
I am trying to sort a particular column “TENOR” on the basis on maturity (group by Currencies) for eg – it should be sorted in the following order ON, SW, 1M, 2M, 3M, 6M, 9M, 1Y, 18M, 2Y and so on.. where ON = Overnight, SW = Single week and 1M = 1 month. i have tried using order by
Is there a way to convert this query into Oracle query using merge statement?
Answer I think this does what you expect. Without table structures and sample input data it is not possible for me to test it.
JOIN MAX per Group
I have a pretty simple sql: SELECT TRIM(Branch.Area) “Area”, Branch.Article “Article” FROM DBA.Branch Branch …
Oracle SQL: invalid identifier error with newly computed column
I am new to Oracle SQL, and any help will be appreciated! I am trying to run this query: select ID, birthyear, substr(‘&Enter_Date’,7,4) Year, Case When birthday is not null Then (Year-birthyear) …
remove olde records grouping by three columns and ordering by date
this is the situation: CREATE SEQUENCE SEQ_tmpdata MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 2206 NOCACHE ORDER NOCYCLE NOKEEP NOSCALE GLOBAL; CREATE TABLE …
How to find unique combinations for a table column in SQL?
I’ve below table: Test create table test (Id char) insert into test values (‘A’), (‘B’), (‘C’), (‘D’), (‘E’) Fiddle Link for testing Expected Output: a.ID b.ID A B A C A D A …
How to update table with data from another table
I have two tables First table INTRA.TABLE_A Second table EXTRA.TABLE_B And I am trying to get data from INTRA.TABLE_A into EXTRA.TABLE_B with update: But it “throws” syntax error at FROM word: syntax_error After update, result should looks like: I am using sqlDeveloper and Oracle database. How can…