question

Haseeb avatar image
Haseeb asked

How can I pull explicit results using for a set of data.

Doc ID Doc Type 12345 MR 12345 MRR 12346 MR 12347 MRR 12348 MRR 12349 MR I want my query to pull following results: Doc ID Doc Type 12346 MR 12349 MR
training
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered
I'm not sure I understand exactly. You're either looking to [pivot the data][1], or you need help with the [WHERE clause][2]. [1]: http://www.mssqltips.com/sqlservertip/1019/crosstab-queries-using-pivot-in-sql-server/ [2]: http://technet.microsoft.com/en-us/library/ms188047.aspx
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

The desired output was actually on two lines in the question source. I formatted it as code so it would be more apparent.
0 Likes 0 ·
Ah, well it's just the WHERE clause that we're interested in then.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.