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 6539503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:51:59+00:00 2026-05-25T10:51:59+00:00

I have a table of questions. The questions can be high priority, low priority,

  • 0

I have a table of questions. The questions can be high priority, low priority, open/answered. What is the best way to create a summary. Should I use a view or several stored procedures?

Table example:

CREATE TABLE [dbo].[question] (
    [Id]            INT          NOT NULL,
    [Priority]      INT          NOT NULL,
    [State]         INT          NOT NULL)

I think creating a view with 4 columns is the best: OpenQuestionHighPriority, OpenQuestionLowPriority, ClosedQuestionHighPriority,ClosedQuestionLowPriority.

Like to know how to do this or other suggestions.

  • 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-05-25T10:52:00+00:00Added an answer on May 25, 2026 at 10:52 am

    You could query that with a case:

    select  sum(case when priority = 1 and state = 1 then 1 end) 
                as OpenQuestionHighPriority
    ,       sum(case when priority = 1 and state = 2 then 1 end) 
                as ClosedQuestionHighPriority
    ....
    from    dbo.question
    

    You could store this query in a view, a procedure, or execute it as ad-hoc SQL. It will work in either form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Requirements : I have a table of several thousand questions. Users can view these
I have a table with questions, where each row is a question and all
I'm having a problem in a SQL command. I have a table with questions,
I have two Tables: Table 1: Questions : QuestionId NUMERIC Title TEXT Test Data
I have a MS access database. In that, one table consists of questions and
have 2 questions : A computer with 32-bit address uses 2-level page table (9
I currently have database setup like so: CREATE TABLE `article` ( `id` int(11) NOT
I have made a high score activity for my game. i used table row
(I using workbench) i have table questions with id, user_id, text and table users
I have a project to create a high traffic search engine similar to altavista.com.

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.