Currently I am working on a project where I need to extract latest data from a table for a report purpose. Below is the sample table structure:- Every student has several courses and course_id for …
Tag: oracle
How to INNER JOIN only one row from second table
I have a issue joining only one row from the second table statement: SELECT ART.*, EAN.* FROM ART,EAN WHERE ART.ARTNR = ean.unit_artnr AND ean.typ = ‘LE4’; TABLE EAN has sometimes 2 …
Lead and case expression
I have this table: ID Date —————– 1 1/1/2019 1 1/15/2019 Expected output: ID DATE LEAD_DATE ————————- 1 1/1/2019 1/14/2019 1 1/15/2019 SYSDATE …
Relational Operators Issue With Null
I am having issues with the below select statement not picking up the data when I insert a relational operator. SELECT C.FIRST_NAME, C.LAST_NAME, B.COMPANY,A.ITEMNO, A.REV, A.DESCRIP FROM ARINVT A …
SQL – Alias, SQL Command not properly ended – Error at line 2 column 23
I’m trying to do a simple left join from two tables(‘asset’,’companies’). For this I decided to use aliases(for the tables) as well, just to practice and improve skills. However I cannot get them to …
How to sum up unique values using case statements having certain conditions
I have a table that may have the same item but with different sizes, I would like to count those items with more than one size (e.g. marvel shirt with S, M sizes will count as “1”), but still be able …
Oracle split repeating rows into columns when joining 2 tables
I have 2 tables like this: table_a id col2 1 A 1 B 2 A 2 B 3 B table_b id col1 1 X 2 Y 3 Z I want to join both the tables such that the resultant contains the repeating row …
Oracle SQL analytical query
SQL> select LAST_UPDATED_DATE, ODOMETER from demo; LAST_UPDA ODOMETER ——— ———- 05-OCT-18 47174.77 08-OCT-18 12-OCT-18 50246.37 15-OCT-18 19-OCT-18 53743.11 21-OCT-18 22-OCT-18 25-…
Disable trigger in another db(Oracle)
Can I create a procedure that disables a trigger in another database? I mean, can I disable it with a database link? I need it for importing data into a data warehouse
SQL group by (count,sum)
Hello i need help abou SQL a have this table and i need this result. thanks for your attention and your answers. select to_char(r.date,’yyyy’) YEAR, sum(1), sum(r.cafe) cafe, sum(r.drink) drink, …