文章分類

C# (27) ASP.NET (13) SQL (7) ORACLE (5) JAVA (2) SQLSERVER2008 (2) 大家都在問的事 (2) ACCESS (1) ANDRIOD (1) JQUERY (1) python (1) 雜談 (1)

關於我自己

我的相片
程式初心者 JAVA, ASP.NET, C# ,SQL

2013年3月6日 星期三

【SQL】用SQL傳回1-100

修改自暗黑執行緒大大的CODE //查詢SELECT DISTINCT NUMBER FROM master.dbo.spt_values WHERE name IS NULL可傳回一段0到2047的數字//


SELECT  CONVERT(VARCHAR(4), Num)+'m' as title, CONVERT(VARCHAR(4), Num) as value

FROM 

(

    SELECT DISTINCT NUMBER AS Num

    FROM master.dbo.spt_values

    WHERE name IS NULL

) NumberPool

WHERE Num BETWEEN 1 AND 100

ORDER BY Num 
 
執行結果
 

1 則留言:

  1. Play Cafe Casino & Brewery - Mapyro
    Explore Cafe Casino & Brewery in Murphy, MA 평택 출장샵 and other places to stay. See activity, reviews, directions, and information for Cafe Casino & Brewery in 청주 출장샵 Murphy,  Rating: 문경 출장마사지 2.3 · 여수 출장안마 ‎53 votes 세종특별자치 출장마사지

    回覆刪除