【发布时间】:2016-07-29 15:53:14
【问题描述】:
这是我的 SQL 服务器查询
` Select top 8
count(id) OVER () as speccount,
(SELECT count(*) From Profile_Master pm WHERE CONCAT(pm.fname , pm.lname) LIKE '%'+@keyword+'%' and
(select Top 1 city from DAddress_Master where profileid=pm.id)=@city) as drcount,
(SELECT count(*) From DAddress_Master dam WHERE dam.city=@city and dam.clinicname LIKE '%'+@keyword+'%') as cliniccount,
specialization AS name,
id as id,
'Specialization' as type,
'' as drspec
From Specialization_Master
Where specialization LIKE '%'+@keyword+'%'`
实际上是我整个查询的一部分。现在我必须将此查询转换为 mysql,这没什么大不了的,但是有人可以告诉 count(*) OVER () 在 mysql 中的替代品吗?
我遇到了这个函数。
选择 SQL_CALC_FOUND_ROWS 和 SELECT FOUND_ROWS();
但是还有其他方法吗??
【问题讨论】:
标签: mysql sql-server