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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:16:56+00:00 2026-05-26T12:16:56+00:00

for a table on ms-sql2000 containing the following columns and numbers: S_idJ_id Se_id B_id

  • 0

for a table on ms-sql2000 containing the following columns and numbers:

S_idJ_id    Se_id   B_id    Status  Count   multiply
63  1000    16  12  1   10  2       
64  1001    12  16  1   9   3       
65  1002    17  12  1   10  2       
66  1003    16  12  1   6   3       
67  1004    12  16  1   10  2       

I want to generate an classic asp script which will do the following for each row
where status=1 :

-multiply -> answer= multiply column ‘count’ with column ‘multiply’

Then:

count the total answer and sum for each se_id like :

se_id   total
12      47
16      38
17      20

and display on screen like

Rank    se_id   total
1       12      47
2       16      38
3       17      20

Condition:
if there are multiple equal total values then give the lower numbered se_id a priority for
getting a ranking and give the next higher numbered se_id the next number in rank

Any sample code in classic asp or advice is welcome on how to get this accomplished

  • 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-26T12:16:57+00:00Added an answer on May 26, 2026 at 12:16 pm

    ‘score’ = source table.

    if (EXISTS (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'result_table')) 
    begin
      drop table result_table;
    end
    
    select 
      rank = IDENTITY(INT,1,1), 
      se_id, sum(multiply * count) as total
    into result_table
    from score
    where status = 1
    group by se_id
    order by total desc, se_id;
    

    [Edit] Change query as answer on first comment

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

Sidebar

Related Questions

I have the following scenario: An SQL 2000 database with a table containing the
I have a table on SQL2000 with a numeric column and I need the
Hi I get problem retrieve XML data from SQL2000 server. The table structure is
table data of 2 columns category and subcategory i want to get a collection
I have a table containing user-account permissions and I'm trying to write a query
I've got the following SQL table: CREATE TABLE [dbo].[Test]( [TestID] [int] NOT NULL, [TestNum]
I am using following SQL over a SQL 2000 table, which contain around 100,000
Lets say I have the following table in MS SQL 2000 Id | description
consider the following table create table sample(id, name, numeric, qno, ans1,ans2,ans3) sample data 1,
there is a difference between how the following code runs on sql2008 and sql2000.

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.