0

Hello!
I need to ask for a little help to build SQL query to delete some records!

Table structure:

charId int(10) DEFAULT NULL,
schameid int(10) NOT NULL AUTO_INCREMENT,
name varchar(250) DEFAULT '',
skills varchar(500) DEFAULT '',
PRIMARY KEY (schameid)
) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;

Some times record skills is empty and it is causing problems for me, how can i delete whole row for this user IF there is no data saved in skills?

Thanks!

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by seslie
0

delete from table_name where skills = '';

Code blocks are created by indenting at least 4 spaces
... and can span multiple lines
0

how can i delete whole row for this user IF there is no data saved in skills

Why would you want to delete the whole information cos a particular column is empty? well, it depends on what the table is there for. But I think this will cause a whole different problem entirely if this is the table with user information. There are better ways to do this. You could insert a default value while creating the record. I hope you get what I mean

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.