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!

Recommended Answers

All 4 Replies

delete from table_name where skills = '';

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

thanks for help :)

mark as solved

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.