anggwaponi Posted March 6, 2008 Share Posted March 6, 2008 hello everyone .i'm here again, in the hope that someone or anyone can assist or give me idea about this basic understanding of (my)sql .i would like to ask on what command or syntax to remove all the "NULL" in the said file? the filename of these documents is my_sql_learning. in addition, once the "NULLs" are removed ... does all the data's moves up? its like i want to remove all the ""NULLs" because its unnecessary and very ugly to look.well, hoping that this is a great help not just to me but to others also who are starting to learned (my)sql . cheers! Link to comment Share on other sites More sharing options...
justsomeguy Posted March 6, 2008 Share Posted March 6, 2008 DELETE FROM table WHERE customerID = nullThat will delete everything where the customer ID is null (obviously). Link to comment Share on other sites More sharing options...
anggwaponi Posted March 6, 2008 Author Share Posted March 6, 2008 DELETE FROM table WHERE customerID = nullThat will delete everything where the customer ID is null (obviously)hello justsumeguy .thanks really for the info that u have shared, it helps a lot to my input ... looks like u have lots of skills when it comes to (my) sql .any way, is it possible to remove or delete all the word "NULL" in the table my_sql_learning at one time? i mean please don't get me wrong and correct me if my impression is wrong as well but the syntax u gave is to remove the word "NULL" per column only as it states " ... WHERE CustomerID ... " clause. then after that, i can then proceed deleting another column in CustomerName, PhoneNo, Call_Date_Time, and so on and so forth.please advise as to what command or syntax to remove all the word "NULL" in the table my_sql_learning at one time only.happy weekend to all.cheers! Link to comment Share on other sites More sharing options...
justsomeguy Posted March 6, 2008 Share Posted March 6, 2008 That SQL statement will remove all rows in the table at once if the customerID column in that row is null. It does not remove only one column, in fact you can't even do that with a database. It removes the entire row if the column matches the condition. SQL statements act on entire rows, not individual columns. Link to comment Share on other sites More sharing options...
Synook Posted March 7, 2008 Share Posted March 7, 2008 You can remove a column with ALTER TABLE (but that would remove the ENTIRE column). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.