This post will only interest some of you hardcore techies out there, but I just needed to share:
Normally, when creating a view in SQL, you can't include an ORDER BY clause to sort the results in a particular fashion. I needed to do this recently, and came up with two workarounds for this limitation:
1. Pre-sort the table: use something along the lines of
2. You Can order your view, if you use the Top clause. So:
Normally, when creating a view in SQL, you can't include an ORDER BY clause to sort the results in a particular fashion. I needed to do this recently, and came up with two workarounds for this limitation:
1. Pre-sort the table: use something along the lines of
SELECT *
FROM (Select * from table order by column_1)
2. You Can order your view, if you use the Top clause. So:
SELECT TOP 100 PERCENT *
FROM TABLE
ORDER BY COLUMN1
No comments:
Post a Comment