DECLARE @i int=0;
DECLARE @j decimal(9,2);
DECLARE @qnum INT=1000;
SET NOCOUNT ON
CREATE TABLE #temp_Table(num decimal(9,2))
WHILE(@i<@qnum)
BEGIN
  SELECT @j = convert(decimal(9,2),(RAND()*10))
  --IF(NOT EXISTS(SELECT num FROM #temp_Table WHERE num=@j ))
  BEGIN
    INSERT #temp_Table (num) VALUES (@j)
    SET @i+=1;
  END
END

SELECT DISTINCT num FROM #temp_Table
SELECT  num FROM #temp_Table
DROP TABLE #temp_Table




相关文章:

  • 2021-08-08
  • 2022-12-23
  • 2021-10-05
  • 2022-03-01
  • 2022-12-23
  • 2021-09-19
  • 2022-12-23
猜你喜欢
  • 2021-10-06
  • 2022-12-23
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
相关资源
相似解决方案