How to select N random rows using a T-SQL Query ?
You can use the TOP keyword and specify the number to retreive the TOP N records that the query returns. Additionally , order the records by newid() function using the ORDER BY clause to make the records random.
How to select N random rows using a T-SQL Query ?
use AdventureWorks2014 GO SELECT top 10 percent * FROM HumanResources.Employee order by newid()

Share this:
Popular Stories
-
All 5 React Bugs Explained & Fixed | React Debugging... youtube.com
-
Why React Components Start with Capital Letters? ? #shorts #react... youtube.com
-
Why setCount 3 times only adds 1 #react youtube.com
-
Gratis! JavaScript Full Stack Bootcamp Node JS React JS and... youtube.com
-
AI Research Paper Compliance Checker | Python Flask + React... youtube.com
Tags
.NET Errors
App
C#
C# Errors
C# programs
COBOL Error Messages
csharp
database
Database Error Messages
DB2 Error Messages
Delphi Errors
Erply API
F#
Google Play
guide
How to
IBM Application Discovery and Delivery Intelligence
IBM InfoSphere Information Server
IBM QRadar
IBM Workload Automation
InterSystems IRIS Errors
Java
Javascript
Lab programs
LINQ
List
MariaDB Errors
MS SQL Server Error Codes
Oracle Errors
python tutorials
SQL Server
tips
tricks
TroubleShoot SQLite Errors
tutorial
tutorials
visual studio 2015
Windows
Windows 10
Windows Errors
Windows Phone
Windows Phone 8
Windows System Errors
wp8
XAML
Recent Stories
-
All 5 React Bugs Explained & Fixed | React Debugging... youtube.com
-
Why setCount 3 times only adds 1 #react youtube.com
-
Why React Components Start with Capital Letters? ? #shorts #react... youtube.com
-
AI Research Paper Compliance Checker | Python Flask + React... youtube.com
-
Gratis! JavaScript Full Stack Bootcamp Node JS React JS and... youtube.com
Leave Your Comment