Sql server
开局一个bug
这个作者很懒,什么都没留下…
展开
-
sql分页
create proc P_pageSizeIndexasdeclare @pageNumber int,@pageSize int --页码 ,--每页条数beginselect top (@pageSize) * from [hongd39.OS_ULog]where LogID not in(select top ((@pageNumber-1)*@pageSize) LogID from [hongd39.OS_ULog])order by LogID descend...原创 2020-09-22 09:25:36 · 60 阅读 · 0 评论 -
SQL(左,右,外,内连接)
SQL server四种连接基本解释 – left join (左连接):返回包括左表中的所有记录和右表中连接字段相等的记录。 – right join (右连接):返回包括右表中的所有记录和左表中连接字段相等的记录。 – inner join (等值连接或者叫内连接):只返回两个表中连接字段相等的行。 – full join (全外连接):返回左右表中所有的记录和左右表中连接字段...原创 2019-08-30 14:17:27 · 94 阅读 · 0 评论 -
查询SQL执行时间
declare @d datetime set @d=getdate() --传统SQL语句select * from [hongd39.RC_Logs]select datediff(ms,@d,getdate()) as [语句执行花费时间(毫秒)]godeclare @d datetime set @d=getdate() --优化后的SQLSELECT *...原创 2019-10-11 14:48:50 · 134 阅读 · 0 评论