Hi No it won't be the same records. The one list is sorted ASC and the other DESC and then I am only selecting the 1st 50% of each list. Your method is probably better. If there is no ID integer in his table, he could still use my Rownumber
In SQL % is used for MOD. I think it was MOD pre SQL 2005.
Assuming there is no incremental integer and we have to create one.
SELECT *,Row_number () over(ORDER BY Fullname)as RowNumber
INTO #TempA
FROM
(
SELECT Fullname, CreatedON , Row_number () over(ORDER BY Fullname) % 2 AS Remainder
FROM SystemUser
)xxx
WHERE Remainder = 0
SELECT *,Row_number () over(ORDER BY Fullname)as RowNumber
INTO #TempB
FROM
(
SELECT Fullname, CreatedON , Row_number () over(ORDER BY Fullname) % 2 AS Remainder
FROM SystemUser
)xxx
WHERE Remainder <> 0
SELECT #TempA.FullName, #TempA.CreatedOn, #TempB.FullName, #TempB.CreatedOn
FROM #TempA
FULL OUTER JOIN #TempB
ON #TempA.RowNumber = #TempB.RowNumber
Marked as answer by peter pi - msft on Mar 16, 2012 10:20 AM
basheerkal
Star
10672 Points
2426 Posts
Re: Dificulties using Repeater (new to this control)
Mar 11, 2012 03:51 AM|LINK
Hi Basquait
won't it show same records in both column in different sort order?
can you try somethging like
SELECT ID AS 1d1, fullName as fullname1 from Table where Mod (id, 2)= 0
LEFT JOIN
SELECT ID as Id2, fullName as fullname2 from Table where Mod (id,2)<> 0
provided ID is an identirty column - ineger type
.. I am not very falilier with SQL queries.
(Talk less..Work more)
Basquiat
Contributor
2385 Points
645 Posts
Re: Dificulties using Repeater (new to this control)
Mar 11, 2012 03:59 AM|LINK
basheerkal
Star
10672 Points
2426 Posts
Re: Dificulties using Repeater (new to this control)
Mar 11, 2012 04:08 AM|LINK
OK I agree.. Thank you for clarifying it.
Then Can you please give the complete query if we use the method I suggested.
B
(Talk less..Work more)
Basquiat
Contributor
2385 Points
645 Posts
Re: Dificulties using Repeater (new to this control)
Mar 11, 2012 05:01 AM|LINK
In SQL % is used for MOD. I think it was MOD pre SQL 2005.
Assuming there is no incremental integer and we have to create one.
basheerkal
Star
10672 Points
2426 Posts
Re: Dificulties using Repeater (new to this control)
Mar 11, 2012 10:58 AM|LINK
Will it work
Here, there is only one table
B
(Talk less..Work more)
Basquiat
Contributor
2385 Points
645 Posts
Re: Dificulties using Repeater (new to this control)
Mar 11, 2012 12:14 PM|LINK
It'll work. I first created 2 Temp tables and then joined them.