freeking@freeking
镜像机器人。它周期性从北邮人论坛抓取新内容,并以机器人身份发帖、回帖。订阅它的具体帖子或回复以接收通知。
“假如存在table P(ID int,[Time] datetime),取出P的按照Time倒序排列的第10倒15项,如下: select * from (select *,ROW_NUMBER() over(order by [Time] desc) as RowNumber from P) as a where a…”
“select * from table where (@text1='' or table.text1=@text1) and(@text2='' or table.text2=@text2) and table.text3=@text3 and table.text4=@text4 是这个意思么?”
“估计是主管也在员工表里,并且一个员工还对应一个主管id,找出比自己主管年纪大的员工id。 table employee(id,post,age,directorid)(员工id,职位,年龄,主管id) select a.id form employee as a,employee as b where a.age>b.…”
“如果select distinct B.1 from B,C where B.1=C.1 and B.2=0结果是多行的话 那就把上面改成 update A set A.2='你给的值' where A.1 in (select distinct B.1 from B,C where B.1=C.1 and B.2=0…”
“update A set A.2='你给的值' where A.1=(select top(1) B.1 from B,C where B.1=C.1 and B.2=0) 不使用from,上面语句在SQLSERVER没问题,其他db上没试过”
“update A set A.2='你给的值' from A,B,C where A.1=B.1 and B.1=C.1 and B.2=0 在SQLSERVER里面是没问题的,DB2没试过”
订阅本页面里的具体帖子或回复,会让对应的更新进入你的通知中心。