troubleshooting Question

SQL Mulitple Select Statemenst in one grid (SQL2008)

Avatar of bounty457
bounty457 asked on
Microsoft SQL Server 2008
6 Comments4 Solutions117 ViewsLast Modified:

i have one SQL Table in MS SQL 2008, and i want to have the results in one grid in different columns.
The result should be in Column Cost1 and column Cost2 and one Row.
In this Statement the result is in one Column and two Rows.

select SUM(costs) AS costs1 from costs where  ID = 1050
select SUM(Amount) AS costs2 from costs  where (type = 1 or type = 4)and ID = 1050;

do you have any ideas how can i do this?
Thank you very much,
regards Bounty

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 4 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros