{"id":575,"date":"2019-12-22T10:03:36","date_gmt":"2019-12-22T02:03:36","guid":{"rendered":"http:\/\/wccass.com\/?p=575"},"modified":"2019-12-22T10:03:36","modified_gmt":"2019-12-22T02:03:36","slug":"mysqlsqlserver%e5%9f%ba%e7%a1%80%e8%bf%9b%e9%98%b6%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/blog.tongyunli.top\/?p=575","title":{"rendered":"MySql&#038;SqlServer\u57fa\u7840\u8fdb\u9636\u603b\u7ed3"},"content":{"rendered":"\n<p>\u6d4f\u89c8\u8fd9\u7bc7\u6587\u6863\u9700\u8981<a href=\"http:\/\/wccass.com\/?p=151\">sql\u57fa\u7840<\/a> \u5982\u679c\u4f60\u7ee7\u7eed\u9605\u8bfb\u6211\u5c06\u9ed8\u8ba4\u4f60\u5df2\u5177\u6709\u76f8\u5173\u57fa\u7840<\/p>\n\n\n\n<p>\u9274\u4e8e\u5927\u5bb6\u90fd\u5df2\u7ecf\u5b66\u4e60\u8fc7mysql\u7684\u8bed\u6cd5 \u8fd9\u7bc7\u5c31\u7ed9\u5927\u5bb6\u8bf4\u4e00\u4e0bmysql\u8bed\u6cd5\u548cSqlserver\u8bed\u6cd5\u7684\u4e0d\u540c\u4e4b\u5904<\/p>\n\n\n\n<p class=\"has-text-color has-background has-very-dark-gray-color has-vivid-green-cyan-background-color\">1.\u81ea\u589e\u503c\u7684\u8bbe\u7f6e<\/p>\n\n\n\n<p> mysql\uff1aid int primary key auto_increment<br> sqlserver\uff1aid int primary key identity(1, 1) \/\/identity(1,1):\u4ece1\u5f00\u59cb\uff0c\u6bcf\u6b21+1<\/p>\n\n\n\n<p class=\"has-background has-vivid-green-cyan-background-color\"><br> 2.SQL Server\u67e5\u770b\u8868\u7ed3\u6784\uff1a<\/p>\n\n\n\n<p>sp_help \u8868\u540d \u6216 sp_columns \u8868\u540d<\/p>\n\n\n\n<p class=\"has-background has-vivid-green-cyan-background-color\"><br> 3.\u67e5\u8be2\u524d\u51e0\u6761(top)<\/p>\n\n\n\n<p> mysql\uff1aselect * from student limit 10;<br> sqlserver\uff1aselect top 10 * from student;<br><\/p>\n\n\n\n<p class=\"has-background has-vivid-green-cyan-background-color\"> 4.\u83b7\u53d6\u5f53\u524d\u65f6\u95f4<\/p>\n\n\n\n<p> mysql\uff1anow()<br> sqlserver\uff1agetdate()<\/p>\n\n\n\n<p class=\"has-background has-vivid-green-cyan-background-color\"> 5.\u4fee\u6539\u5b57\u6bb5\u7684\u6570\u636e\u7c7b\u578b<\/p>\n\n\n\n<p> mysql\uff1aalter table test2 modify id bigint;<br> sqlserver\uff1aalter table emp alter column[id] bigint<\/p>\n\n\n\n<p class=\"has-background has-vivid-green-cyan-background-color\"> 6.\u5bf9\u679a\u4e3e\u5b57\u6bb5\u7684\u5904\u7406<\/p>\n\n\n\n<p> mysql\uff1asex enum(\u2018male\u2019,\u2018female\u2019) not null default \u2018male\u2019<br> sqlserver\uff1asex NVARCHAR(2) CHECK(sex=\u2018\u7537\u2019 OR sex=\u2018\u5973\u2019)<\/p>\n\n\n\n<p class=\"has-background has-vivid-green-cyan-background-color\"> 7.\u622a\u53d6\u5b57\u7b26\u4e32<\/p>\n\n\n\n<p> mysql\uff1aSUBSTRING\u548cSUBSTR<br> sqlserver\uff1aSUBSTRING<\/p>\n\n\n\n<p class=\"has-background has-vivid-green-cyan-background-color\"> 8.\u67e5\u770b\u7cfb\u7edf\u5185\u6240\u6709\u6570\u636e\u5e93\u3001\u6240\u6709\u8868<\/p>\n\n\n\n<p> mysql\uff1ashow databases\uff1b\u548c show tables;<br> sqlserver\uff1aSELECT name, database_id, create_date FROM sys.databases; \u548c select * from sysobjects where xtype= \u2018U\u2019;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6d4f\u89c8\u8fd9\u7bc7\u6587\u6863\u9700\u8981sql\u57fa\u7840 \u5982\u679c\u4f60\u7ee7\u7eed\u9605\u8bfb\u6211\u5c06\u9ed8\u8ba4\u4f60\u5df2\u5177\u6709\u76f8\u5173\u57fa\u7840 \u9274\u4e8e\u5927\u5bb6\u90fd\u5df2\u7ecf\u5b66\u4e60\u8fc7mysql\u7684\u8bed\u6cd5 \u8fd9\u7bc7 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":417,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[30,32,22],"class_list":["post-575","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-mysql","tag-sqlserver","tag-projk"],"_links":{"self":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/posts\/575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=575"}],"version-history":[{"count":0,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/posts\/575\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=\/wp\/v2\/media\/417"}],"wp:attachment":[{"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.tongyunli.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}