I am having problems retrieving some data from a table,
Tablename = "Magazine"
Columns
MagazineID MagazineName
1
2 Times
3 People
4 National Geographic
5 US
6 Sports Illustrated
I am trying to bind a dropdownlist in .net with the 4 newest magazines
and the empty magazine.
SELECT TOP 1 MagazineID, MagazineName from Magazine
UNION
SELECT TOP 4 MagazineID, MagazineName from Magazine
Order by MagazineName;
The first part returns
1,''
The second part returns
1,''
2,'Times'
3,'People'
4,'National Geographic'
Given the above data, how can I get the sql results to display
5 'US'
4 'National Geographic'
3 'People'
2 'Times'
1 ''
Essentially i need to do the following
Select Top 1 MagazineID, MagazineName from Magazine Order by MagazineID
and add to it
Select Top 4 MagazineID, MagazineName from Magazine Order by MagazineID
desc