Question:
How do i remove blank columns when using select * from table?
2008-01-15 00:55:47 UTC
example
idnumber name age sex
1 charles 8
i dont want to see the sex in the grid
i need this because im using multiple tables in one grid
it should only show idnumber name age not columns with null values this is only and example im handling tables where it has 50+ columns joined by multiple tables. thanks for the help
Six answers:
Dave Batista
2008-01-15 01:04:00 UTC
if i am not wrong right click and u can see del rows
2008-01-15 01:07:17 UTC
Why not select only the columns you are interested in?



You can also run column based "if then" tests per column to test if it is null, then replace it with a different value.
marsulein
2008-01-15 01:12:03 UTC
First of all, if you have a null value in the "Sex" field, that shows you need to re-design your database. If that is a mandatory field, your system should prompt the user to enter sex if they leave it blank.



Now that your DB is "incomplete" there is no way you can separate that. If you use a statement which filters out all those records with null sex records, you wouldn't be able to get their name and ID.
Leo Sendra
2008-01-15 07:36:17 UTC
select idnumber, name, age from table where idnumber is not null or name is not null or age is not null;
2016-10-24 03:48:06 UTC
ought to an guy or woman be likely pranking you? It appears like each and every man or woman has linked autocorrect on your ms note. try checking suitable real right here; record - ideas - Spellchecking - Autocorrect ideas contained in the more suitable an element of the window
klip
2008-01-15 01:16:42 UTC
SELECT `idnumber`, `name`, `age` FROM `example_table`;


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...