[code=SQL]
select top (5*1) Id from table where SourceId=22292
[/code]
id
108
107
106
95
93
然后
[code=SQL]
select min(tt.id) from
(select top (5*1) Id from table &n ......
select b.AccountantID,dbo.hidtelpart(a.tel),midreceivedate,
isnull(c.enddate,Dateadd(yy,1,midreceivedate)) as enddate,
b.bankdate ,a.amount,DateDiff(mm,midreceivedate,enddate)as m
from dbo.AccountantFinal as a
join dbo.Accountant as b on a.SourceID=b.AccountantID
--join CustomerEx ......
所有视图中都是没有唯一的KEY,没办法做not in, 如果 row_number的话 每次查询都需要建立索引。 越到后面越慢。
请问高手们 还有没有更高效一点的SQL。
sql语句:
select top 每页的条数 from table where id not in (select top (当前页数-1)*每页条数 id from tale)
&nb ......
SQL code:
select *,id=(select count(1)+1 from tb where user_id<a.user_id)
from tb a
这条句子中的 where user_id<a.user_id是怎么比较的 user_id和a.user_id不是应该相同的吗?为什么带上这条where后id的之就是1,2,3,4,5,6,7.....
-------------------------------------------
自学很累,有时候很 ......
有下面数据
a b c
271108 1.00 0.01
271109 1.00 0.01
271110 1.00 0.01
271111 1.00 0.01
271112 1.00 1.00
271113 2.00 0.01
271114 1.00 0.01
271115 1.00 0.01&nb ......
把sql写入xml后,当我们用的sql语句的时候,再去调用xml文件,这种实现是什么里面的?
貌似hibernate框架里的?
我也是菜鸟,不确定
ibatis
ibatis
能详细点吗?
吧sql语句写到ibatis的配置文件
懂了。。。
......