首页 > 数据库技术 > 详细

Mysql 和 SQLServer 使用SQL差异比较

时间:2018-08-22 12:35:57      阅读:173      评论:0      收藏:0      [点我收藏+]

查询前100条数据

#mysql
select * from table_name limit 100 ;

#sqlserver
select top 100 * from table_name ;

从数据库.表 定位表

#mysql写法:库名.表名

select password from Info.users where userName=boss

#Sqlserver写法:库名.dbo.表名 ;或者:库名..表名 (注:中间使用两个点)

select password from Info.dbo.users where userName=boss

获取时间

MySQL写法:now() 
SQLServer写法:getdate()

联结查询 

# mysql & sqlserver 
select a.* , b.TypeName from Book as a left join BookType as b ON a.TypeId = b.TypeId 

 

Mysql 和 SQLServer 使用SQL差异比较

原文:https://www.cnblogs.com/xiaoliwang/p/9516904.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!