Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Returning duplicate values in a given order

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-27 : 22:47:03
Arni writes "How do i construct a query to return duplicate rows in a given order?

for example:
given the table <TABLE:-
NAME | AGE
AAA 1
BBB 2

i want to use a query similar to:-
select NAME from <TABLE where AGE in (1,2,1,2,1);

and the output needs to be in the same order as it was entered:
for example:- ('AAA','BBB','AAA','BBB','AAA')

IS THIS POSSIBLE?"
   

- Advertisement -