SQL: How to filter all the rows containing a certain product based on the value of a third column
I have a table with three columns: job_id, part, and time, which represent the ID of a shop job, the part manufactured in that job, and the time taken for that job, respectively.
How to select records whose date difference falls within the desired range [closed]
Closed 5 days ago.
Get all tax rates within a given date range
I have a table with tax rates. Each tax rate has two date fields: ‘valid_from’ and ‘valid_to’. ‘valid_to’ can be NULL, then the tax rate is valid until a later tax rate is inserted. Now I want to determine all tax rates valid in a given period with :start_date and :end_date. The problem is that a tax rate without ‘valid_to’ is valid, viewed individually, as long as its valid_from is not after the given period. So I have to take into account whether such tax rates have been replaced by later tax rates. But it can also be the case that a tax rate with valid_to = NULL falls in part of the given period and then a new tax rate takes over the next part of the period.
My approach still has problems with this:
sql-Whether the database query is projected or joined first?
For the following sql query statements: Select Distinct sno, sname From Student, SC Where Student.sno=SC.sno And cno=’C001′ Please use common sense to determine which of the following query plans should be executed most efficiently? (Assuming the SC has a citation on the cno and the Student has an index on the snoo) ()
sql-Whether the database query is projected or joined first?
For the following sql query statements: Select Distinct sno, sname From Student, SC Where Student.sno=SC.sno And cno=’C001′ Please use common sense to determine which of the following query plans should be executed most efficiently? (Assuming the SC has a citation on the cno and the Student has an index on the snoo) ()
Remove second “Day” column and Turn nulls to 0
I have the following query in MySQL:
Cascading rolling total logic in SQL
I am trying to recreate the cascading sum logic of our Student Information System (SIS) to build a tracking report that will aggregate all graduation requirements in one place.
Select rows based on condition for decimal columns returns nothing
I have the following table:
Wrong comparing double column to string in MySQL [duplicate]
This question already has answers here: mysql query compare string with int value (3 answers) Closed 17 days ago. SELECT t.id, t.status, t.charges FROM parcel AS t WHERE t.user_id = 1 AND t.status = ‘delivered’ AND t.charges = ‘some string’ ORDER BY t.id DESC i have this mysql query. it returns some result, but it […]
Get Records between dates and exist at least 3 times
I have table with over 35 million email records.