Advertisement

08.15.2007 at 06:25AM PDT, ID: 22764007
[x]
Attachment Details

How to get row number in sql?

Asked by swansonplace in SQL Query Syntax, MS SQL Server

Tags: , , ,

How do I assign a distinct unique number to each field returned.  I prefer to do it in sql and not create an index as the table as I do not have sole control of the table.  In the below desired output description this would be RowIndex.

SQL 2000
Statement to add rowindex to:
select distinct(Description) as LawSpecialty from lawspecialty

desired output
LawSpecialty              RowIndex
Bankrupcy                   1
Divorce                        2Start Free Trial
[+][-]08.15.2007 at 06:32AM PDT, ID: 19699298

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.15.2007 at 06:33AM PDT, ID: 19699303

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.15.2007 at 06:34AM PDT, ID: 19699313

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.15.2007 at 06:37AM PDT, ID: 19699341

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.15.2007 at 06:44AM PDT, ID: 19699413

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.15.2007 at 07:19AM PDT, ID: 19699781

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.15.2007 at 07:24AM PDT, ID: 19699853

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.15.2007 at 08:14AM PDT, ID: 19700368

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.15.2007 at 08:43AM PDT, ID: 19700653

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, MS SQL Server
Tags: row, number, sql, get
Sign Up Now!
Solution Provided By: aneeshattingal
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628