473,503 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

calculate score in ms sql

2 New Member
Hi,



Suppose I have a table with 5 rows (t1 - t5) and 6 columns (c1 - c6) and I run a select query on it using the where clause.. (specifying value of c1) and in the result I get two rows say T1 and T4 ,,now I want to rank my results based on the other unknown columns..

Is there any way to calculate the rank (score) of the resultant rows?
Mar 2 '08 #1
3 2179
ck9663
2,878 Recognized Expert Specialist
Hi,



Suppose I have a table with 5 rows (t1 - t5) and 6 columns (c1 - c6) and I run a select query on it using the where clause.. (specifying value of c1) and in the result I get two rows say T1 and T4 ,,now I want to rank my results based on the other unknown columns..

Is there any way to calculate the rank (score) of the resultant rows?

if you could post some sample mock data, of your table and what you want to accomplish, it would be much easier..

-- CK
Mar 2 '08 #2
Brad Orders
21 New Member
I'm not sure, but is this the kind of thing you are after?

Expand|Select|Wrap|Line Numbers
  1. SELECT C1
  2. FROM TableName
  3. WHERE C1 = @SomeParameter
  4. ORDER BY C2, C3, C4
  5.  
If you want to order the results by a column in descending order, just put DESC after the column name (eg. "C2 DESC")

HTH.
Mar 2 '08 #3
amitpatel66
2,367 Recognized Expert Top Contributor
Hi,



Suppose I have a table with 5 rows (t1 - t5) and 6 columns (c1 - c6) and I run a select query on it using the where clause.. (specifying value of c1) and in the result I get two rows say T1 and T4 ,,now I want to rank my results based on the other unknown columns..

Is there any way to calculate the rank (score) of the resultant rows?
Could you please be more specific or your requirement. A sample data with a sample output required will help the experts to better understand your requirement.
Mar 3 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3994
by: Phil Powell | last post by:
Relevancy scores are normally defined by a MySQL query on a table that has a fulltext index. The rules for relevancy scoring will exclude certain words due to their being too short (minimum...
54
6565
namcintosh
by: namcintosh | last post by:
First of all, here is my program: #include <iostream> #include <conio> using namespace std; //Function prototype void getscore(int&, int&, int&, int&, int&); void findLowest (int, int,...
1
2036
by: CrostonScottish | last post by:
Has anybody got any ideas or nifty code for calculating the median value in a form. I currently have a database which we use for post-course evaluations. Part of the evaluation asks the attendees...
1
1946
by: chittasuman | last post by:
QUESTION: There is a xml node like <icc> <cricket> <player>sachin</player> <score>15</score> </cricket> <cricket> <player>dravid</player>
9
1493
by: Desyree | last post by:
I am putting together a database with the fields: 1. Number of Projects 2. Project (Name) 3. Project Contact 4. Company 5. Location (City, State) 6. Last Contact Date 7. Mw/g 8. Project Type
1
3495
by: tonytj | last post by:
This program will read in studentID (3 digit integer number), three quizzes score, four assignments score and two tests scores. Each of the quizzes, assignments, and tests has up to 100 points. The...
4
2337
by: gaya12 | last post by:
In ASP and using Ms access. I have a form which asks users to input some details. The details entered by the user will stored in a access database and also there is a calculation based on the...
3
4399
by: blamp | last post by:
I have completed most of the program I just cant get the letter grade to print from the void printGrade function.The output of the program should be: Line 1: Based on the course score, this...
5
2659
rcollins
by: rcollins | last post by:
I have a query that runs off a criteria form. What I need to do is fix it so that when I select June from the combo box, it gives me back June, May, April and March. The format in the combo box...
0
7091
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7342
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7464
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
391
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.