那些程式猿會忘記的簡單細節-db,忘記細節-db

來源:互聯網
上載者:User

那些程式猿會忘記的簡單細節-db,忘記細節-db

1.日期加一天             dateadd(day,1,'2013-12-31') 

2.去前幾條          sqlerver裡面可以用top 1       mysql裡面可沒有的  只能用limit

3.當前日期          sqlserver是getdate()             mysql是now()   curdate()  curtime()

4.標識符限定符  sqlserver 是 []            mysql 是 ``

5.字串相加   sqlserver 是 +             mysql 是 concat()

6.是否為空白     sqlserver 是 isnull()      mysql 是 ifnull()

7.隨機函數     sqlserver 是 newid()       mysql 是 uuid()

8.剛剛插入的idsqlserver 是 @@IDENTITY   mysql 是 last_insert_id()


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.