FName MName LName
Gaurav NULL Kumar
Piyush Sharma NULL
How can I write a query so that I can get an output without null values. I dont want them in my result.
Gaurav Kumar
Piyush Sharma
Here is the solution;
- select IsNull(FName,'') + ' ' + IsNull(MName,'') + ' ' + IsNull(LName,'') from tableName

Gaurav KumarPosted Nov 11, 2014, 2:07 AM
@anjani kumar, after testing your query, I didn't find any difference. Both queries give the same result. see the attached image. http://postimg.org/image/h5bqqf59h/
anjani kumarPosted Nov 11, 2014, 1:50 AM
If "MName" Contains Null Value then result gives two Blank spaces between FName and MName. Use following query to remove space issue- select replace(IsNull(FName,'') + ' ' + IsNull(MName,'') + ' ' + IsNull(LName,''),' ',' ') from TableName