Click here to Skip to main content
15,881,803 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Get Max for each group Pin
vvashishta23-Apr-12 19:16
vvashishta23-Apr-12 19:16 
QuestionSSRS 2005 question Pin
SQL Ed20-Apr-12 10:13
SQL Ed20-Apr-12 10:13 
Questionmysql to ms sql server Pin
Ramkumar_S19-Apr-12 21:27
Ramkumar_S19-Apr-12 21:27 
AnswerRe: mysql to ms sql server Pin
Eddy Vluggen20-Apr-12 0:48
professionalEddy Vluggen20-Apr-12 0:48 
AnswerRe: mysql to ms sql server Pin
jschell20-Apr-12 10:27
jschell20-Apr-12 10:27 
QuestionGetting unique combination of rows in SQL?? Pin
Lima318-Apr-12 21:08
Lima318-Apr-12 21:08 
AnswerRe: Getting unique combination of rows in SQL?? Pin
AHSAN11118-Apr-12 21:31
professionalAHSAN11118-Apr-12 21:31 
AnswerRe: Getting unique combination of rows in SQL?? Pin
Blue_Boy19-Apr-12 0:57
Blue_Boy19-Apr-12 0:57 
here it is

SQL
DECLARE @TEST TABLE (X VARCHAR(10),Y VARCHAR(10))
 
insert into @TEST values ('A','B')
insert into @TEST values ('C','D')
insert into @TEST values ('E','F')
insert into @TEST values ('B','A')
insert into @TEST values ('D','C')
insert into @TEST values ('F','E')


SELECT A.X
,(
select  top 1 b.y from @test as b where b.y > a.x  and b.x<a.y
) as subY

 FROM @TEST A
where 
(
select  top 1 b.y from @test as b where b.y > a.x  and b.x<a.y
) is not null
order by a.x


I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.

GeneralRe: Getting unique combination of rows in SQL?? Pin
Lima319-Apr-12 1:53
Lima319-Apr-12 1:53 
GeneralRe: Getting unique combination of rows in SQL?? Pin
Lima319-Apr-12 1:56
Lima319-Apr-12 1:56 
GeneralRe: Getting unique combination of rows in SQL?? Pin
Lima319-Apr-12 2:38
Lima319-Apr-12 2:38 
GeneralRe: Getting unique combination of rows in SQL?? Pin
Blue_Boy19-Apr-12 2:45
Blue_Boy19-Apr-12 2:45 
QuestionTraking Offence Pin
Billa218-Apr-12 20:06
Billa218-Apr-12 20:06 
AnswerRe: Traking Offence Pin
Mohibur Rashid18-Apr-12 20:45
professionalMohibur Rashid18-Apr-12 20:45 
GeneralRe: Traking Offence Pin
Billa218-Apr-12 22:09
Billa218-Apr-12 22:09 
Questioncomplicated SQL: How to filter duplicate data about technical support and compute rank Pin
bbaaking16-Apr-12 16:54
bbaaking16-Apr-12 16:54 
AnswerRe: How to filter duplicate data about technical support and compute rank Pin
TenmanS1417-Apr-12 11:00
TenmanS1417-Apr-12 11:00 
GeneralRe: How to filter duplicate data about technical support and compute rank Pin
bbaaking17-Apr-12 16:41
bbaaking17-Apr-12 16:41 
GeneralRe: How to filter duplicate data about technical support and compute rank Pin
TenmanS1417-Apr-12 21:59
TenmanS1417-Apr-12 21:59 
GeneralRe: How to filter duplicate data about technical support and compute rank Pin
bbaaking17-Apr-12 22:20
bbaaking17-Apr-12 22:20 
AnswerRe: How to filter duplicate data about technical support and compute rank Pin
Jörgen Andersson17-Apr-12 22:37
professionalJörgen Andersson17-Apr-12 22:37 
GeneralRe: How to filter duplicate data about technical support and compute rank Pin
bbaaking17-Apr-12 22:54
bbaaking17-Apr-12 22:54 
AnswerRe: complicated SQL: How to filter duplicate data about technical support and compute rank Pin
TenmanS1418-Apr-12 11:40
TenmanS1418-Apr-12 11:40 
GeneralRe: complicated SQL: How to filter duplicate data about technical support and compute rank Pin
bbaaking18-Apr-12 21:56
bbaaking18-Apr-12 21:56 
AnswerI have solved it by myself Pin
bbaaking22-Apr-12 20:22
bbaaking22-Apr-12 20:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.