Not able to delete complete row in SQL [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 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

Related

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)

Getting an error when creating a decimal entry in Mysql workbench [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 month.
Improve this question
I am getting an error when setting a decimal value in MySQL workbench.
What am I doing wrong here?
See screenshot.
Can you removed the () from the DECIMAL() and instead enter the DECIMAL only.

how to find a record between two values [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 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`;

Multiple row insert in a mysql table [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 years ago.
Improve this question
Hi I need to update multiple rows in a table so I wrote below query, but it only updates the first row and not the others. Please help.
Query:
String sql = "REPLACE INTO subscriber_metadata (msisdn, have_had_speech_pkg, have_had_sms_pkg, created, changed) values ";
Well REPLACE INTO does the following DELETE + INSERT, what you're looking for is UPDATE, doc over here
REPLACE INTO is nothing more than a mechanical DELETE and INSERT. It can incite mysqld to address deadlocks (See my answer to How I prevent deadlock occurrence in my application?)