HomeОбразованиеRelated VideosMore From: itgeared

The SQL DELETE Statement

62 ratings | 31319 views
This video tutorial covers how to use the SQL DELETE Statement. More guides and tutorials: http://www.itgeared.com/. The SQL DELETE Statement is used to delete rows from a database table.
Html code for embedding videos on your blog
Text Comments (17)
mashuk hossain (10 months ago)
How to delete a single record from a table without deleting the whole row?
RAMIREDDY C (11 months ago)
how to delete multiple tables by using delete command in SQL ( not sql server).
R. D'z (1 year ago)
what is the query for deletion of person Details?
Jorge Mederos (1 year ago)
DELETE FROM table_name WHERE ID=#
R. D'z (1 year ago)
How to delete Details of a person From a table?
Jorge Mederos (1 year ago)
DELETE FROM table_name WHERE ID=#
angel aiyappa (1 year ago)
does delete * from table name work??
Jorge Mederos (1 year ago)
angel aiyappa - no because the delete statement deletes a row of data not a field so it isnt necessary to tell SQL to include all fields by specifying "*"
angel aiyappa (1 year ago)
does delete * from table name work??
Sandeep singh (2 years ago)
how to delete all the record older than 100 days please tell
itgeared (2 years ago)
sorry, this isn't the correct platform for the type of questions you are asking. my recommendation is to submit your generic questions on a SQL forum. there are plenty out there. otherwise, your comments and mine will fill pages on this site.
Sandeep singh (2 years ago)
thanks for your reply .. actually i m not master at SQL .. i have not done anything yet .. . please if possible tell me .. wether i should type ( Date< required date) or (day-100,getdate ..) please sir explain once
itgeared (2 years ago)
you should always try and when you reach out for help, tell others what problem you are having and what you have tried. you will learn the material much better with this approach. DELETE FROM tblName WHERE [datefield] < DATEADD(day, -100, GETDATE())
Kenneth Diaz (2 years ago)
The favorite statement of black hats.
itgeared (5 years ago)
Are you supplying the correct format for the date? The format should match the field's format. It looks like this is C# code, have you tried to run the query (or in the case a nonQuery) from the DB Management interface, I assume MSSQL here, so MSSQL Management Studio?
Teck Wai (5 years ago)
May i ask why my query is String sql = "delete from Schedule where sch_date < '17/07/2013'"; and the sch_date in database is date datatype, when i run, it give me the datatype mismatch error
itgeared (6 years ago)
@multimediaarts - Depends, but if you have a unique primary key in this table, just append the where clause, the field name does not equal 1. (If i write the sql statement, youtube prevents me from posting the answer.). If you need help, go to my site, itegared.com, and go to the forum section. I can continue to help you there.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.