Randomly takes a few data SQL statements

xiaoxiao2021-03-06  18

Select * INTO #T

From (SELECT TOP 30 *

FROM table

WHERE condition

Order By Sort Expression) Temporary Table Name

/ * The following sentence is to remove the random 3 data from the created temporary table * /

Select Top 3 * from #t Order by newid ()

/ * Delete the created temporary table * /

DROP TABLE #T

转载请注明原文地址:https://www.9cbs.com/read-40440.html

New Post(0)