I have a table [Tbl1] containing two fields.
ID as int And
TextValue as nvarchar(max)
Suppose there are 7 records. I need a resultset that has two columns Text1 and Text2.
The Text1 should have first 4 records and Text2 should have remaining 3 records.
[Tbl1]
ID | TextValue
1. | Apple
2. | Mango
3. | Orange
4. | Pineapple
5. | Banana
6. | Grapes
7. | Sapota
Now, the result-set should have
I wonder how this can be useful, but I think you could try the following:
Test case:
Result:
UPDATE:
As @AlexCuse suggested in a comment below, you could also use a variable to get the row count of the table, in order to have a query that works for any number of rows: