Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SELECT [Rank]
,[Priority]
,[% Complete]
,[Project Name]
,[Project Manager]
,[Assigned To]
,[Category]
,[Impacted Group(s)]
,[Status]
,[Requested Due Date]
,[Requested By]
,[Project Champion]
,[Created]
,[AVP Team]
FROM [COE_PROJECTS].[19].[COE_PROJ_01_19_2017]
order by 1

What I have tried:

I dont really know what to try. I am quite new to SQL.
Posted
Comments
OriginalGriff 26-Jan-17 15:39pm    
This isn't agood question - it doesn't tell us what your problem is, just a trivial bit of SQL.
And why ORDER BY 1 ? That's completely useless as it specifies that all rows have the same sort order!
[no name] 26-Jan-17 15:51pm    
http://www.techsupportalert.com/content/how-ask-question-when-you-want-technical-help.htm will show you how to ask a question.
Patrice T 26-Jan-17 16:57pm    
Afzaal Ahmad Zeeshan 26-Jan-17 19:29pm    
Leaving something blank is also similar to having NULL (does not exist). In many cases, you can use NULL values to sort the data by passing a WHERE column_name IS NOT NULL and SQL will itself manage the data.

So, in short, keep the data NULL instead of empty.

1 solution

Hello:
I'm not sure of the meaning of your question. But if the question is how to change the output of your query from null to "blank", you can use coalesce function.
Assuming that "project name" is a string and "% complete" is numeric the query will be:

<br />
select [Rank]<br />
,[Priority]<br />
,COALESCE([% Complete],0) AS [% Complete]<br />
,COALESCE([Project Name],'') AS [Project Name]<br />
,[Project Manager]<br />
,[Assigned To]<br />
,[Category]<br />
,[Impacted Group(s)]<br />
,[Status]<br />
,[Requested Due Date]<br />
,[Requested By]<br />
,[Project Champion]<br />
,[Created]<br />
,[AVP Team]<br />
FROM [COE_PROJECTS].[19].[COE_PROJ_01_19_2017]<br />
order by 1<br />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900