Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8449169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:37:58+00:00 2026-06-10T10:37:58+00:00

I have procedures pulling data from various sources to give me 3 VERY similar

  • 0

I have procedures pulling data from various sources to give me 3 VERY similar tables.

Metric          | Tickets   |Band
______________________________________
Acknowledgement | 45        | New
Acknowledgement | 23        | Within
Acknowledgement | 16        | Near
Acknowledgement | 2         | Very Near

And

Metric     | Tickets   |Band
___________________________________
Escalation | 10        | New
Escalation | 43        | Within
Escalation | 81        | Near
Escalation | 6         | Very Near

And

Metric| Tickets   |Band
___________________________________
Fixed | 34        | New
Fixed | 52        | Within
Fixed | 36        | Near
Fixed | 4         | Very Near

Now, I would like to combine them together in some way to have one table output like this

Metric          | New   | Within | Near | Very Near
_____________________________________________________
Acknowledgement | 45    | 23     | 16   | 2
Escalation      | 10    | 43     | 81   | 6
Fixed           | 34    | 52     | 36   | 4

How can I achieve this in MS SQLServer, please ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:37:59+00:00Added an answer on June 10, 2026 at 10:37 am

    This is a fake pivot that should get what you want. You would then union this query for each table.

    SELECT 
        Metric,
        MAX( CASE Band WHEN 'New' THEN Tickets ELSE '' END ) New, 
        MAX( CASE Band WHEN 'Within' THEN Tickets ELSE '' END ) Within, 
        MAX( CASE Band WHEN 'Near' THEN Tickets ELSE '' END ) Near, 
        MAX( CASE Band WHEN 'Very Near' THEN Tickets ELSE '' END ) [Very Near]
    FROM 
        table
    GROUP BY 
        Metric
    
    UNION
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview which is pulling it data from a stored procedure. In
I have a php page pulling data from a sql2000 stored procedure representing the
I have a stored procedure on SQL Server 2005. It is pulling from a
Let's say you have a form with a component that displays data from a
We have two stored procedures in Microsoft SQL Server that return data that is
I have some stored procedures to execute that use dbms_output.put_line() to put data into
I have stored procedures in SQL Server T-SQL that are called from .NET within
I have a simple stored procedure that is pulling data for a SS report.
I still have loads to learn. At the moment I have stored procedures, and
I have 2 stored procedures ( sp1 and sp2 ) in SQL Server 2005

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.