使用:
WITH sample AS ( SELECt t.*, ROW_NUMBER() OVER (PARTITION BY t.state ORDER BY NEWID()) AS rank FROM ZIPCODES t)SELECt s.* FROM sample s WHERe s.rank <= 5
欢迎分享,转载请注明来源:内存溢出
使用:
WITH sample AS ( SELECt t.*, ROW_NUMBER() OVER (PARTITION BY t.state ORDER BY NEWID()) AS rank FROM ZIPCODES t)SELECt s.* FROM sample s WHERe s.rank <= 5
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)