ASP.NET is a development framework for building web pages and web sites with HTML, CSS, JavaScript and server scripting.
ASP.NET supports three different development models:
Web Pages, MVC (Model View Controller), and Web Forms.
Tuesday, August 7, 2012
retrieve a random record from a sql server table
SELECTTOP1*FROMtableORDERBY NEWID()
SELECT*FROMtableORDERBY NEWID()
A NEWID() is generated for each row and the table is then sorted by it. The first record is returned (i.e. the record with the "lowest" GUID).
No comments:
Post a Comment