Skip to content

Tag: sql

SQL timestamp filtering based only on time

I want to create a query in Oracle SQL that will grab records from a given time interval, during certain hours of the day, e.g. records between 10am to noon, in the past 10 days. I tried this, but it does not work: where timestamp is of type TIMESTAMP. I have also thought of using a join, but I am

basic sql employee

The employee table (EMP) specifies groups by department code, the sum of salaries by group, the average (constant treatment), and the number of people in each group’s salary, and is presented below, listed in department code order. I would like to modify the following SQL syntax to look up departments w…

SQL Compare rows of a table with multiple columns

I have a table T1 Id Col1 Col2 IsActive 1 T1 v1 1 2 T2 v2 0 Now received the following data and it need to be inserted into the above table. As this data contains some duplicated values, it need to be inserted based on IsActive Column value. For row with IsActive 1, need to insert with IsActive 2