how to find a record between two values [closed] - mysql

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I have the following table where there are two relevant fields for searching, this is 'from' and 'to' and represents the range of employees and then the field 'InitialQMSDays' represents the value that I want to return.
So if I have a search value of say 6, it would look at that value and find it between the 6 - 10 row, and return 2.
any ideas?

SELECT InitialQMSDays
FROM my_table
WHERE 6 BETWEEN `From` AND `To`;

Related

Trying to combine two sql queries into one: Combining a with clause with Count/Group By [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 days ago.
Improve this question
Image of two sequel queries
Basically, I want it to display all films with language name spanish and show the amount of actors in each.

my sql select Query not working what is we expected [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 days ago.
Improve this question
class table
class table
students table
students table
teacher's table
teacher's table
expected output table
expected output table
i tried left join but i am getting multiple record's getting.

Get last data for rows [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 months ago.
Improve this question
I have table like this :
then i want query data like this :
how did to do that?
A subquery with group by should do the job:
select * from <table_name>
where (serial_number, attempt) in (select serial_number, max(attempt) from <table_name> group by serial_number)

Not able to delete complete row in SQL [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed last year.
Improve this question
Wanted to delete complete row, which contains NULL entries in sql with command
DELETE FROM student WHERE ID=NULL;
What is wrong in this code?
Your syntax is incorrect you need to check for IS NULL
DELETE FROM student WHERE ID IS NULL;
Adding link to documentation thanks to D M
Working with NULL values

displays all data with certain field types, from the results of the query [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
displays all data with certain field types, from the results of the query ...
I do queries in three tables, and only show data that has relations only, whereas I want to display everything even though there is no relation ...
the data that I have
I want to display the data as below
You need to use left join in this case
select a.position,c.nama from posisi a,kanaikan_posisi b,bana c
where a.id_position = b.id_position (+) and c.id_karyavan (+) = b.id_karyavan
order by a.id_position