日期:2014-05-18  浏览次数:20583 次

用sql输出正弦曲线
就当活跃活跃气氛吧~


------解决方案--------------------
竖着的行不行?俺还不会行列转换~
SQL code

declare @x float
declare @tb table(y float)

set @x = 0

while @x < 360
  begin
    insert into  @tb select ROUND(SIN(RADIANS(@x)) * 100,0)
    set @x = @x + 5
  end 
  
select space(201 + y - 100 )+ '*' from @tb


----------------------------------------------------------------------------------------------------------------
                                                                                                     *
                                                                                                              *
                                                                                                                      *
                                                                                                                               *
                                                                                                                                       *
                                                                                                                                               *
                                                                                                                                                       *
                                                                                                                                                              *
                                                                                                                                                                     *
                                                                                                                                                                            *
                                                                                                                                                                                  *
                                                                                                                                                                                       *
                                                                                                                                                                                            *
                                                                                                                                                                                                *
                                                                                                                                                                                                   *
                                                                                                                                                                                                      *
                                                                                                                                                                                                       *
                                                                                                                                                                                                         *
                                                                                                                                                                                                         *
                                                                                                                                                                                                         *