SQL Server关于分页 SQL 的资料许多,有的使用存储过程,有的使用游标.本人不喜欢使用游标,我觉得它耗资.效率低:使用存储过程是个不错的选择,因为存储过程是颠末预编译的,执行效率高,也更灵活.先看看单条 SQL 语句的分页 SQL 吧.方法1:适用于 SQL Server 2000/2005SELECT TOP 页大小 * FROM table1 WHERE id NOT IN ( SELECT TOP 页大小*(页数-1) id FROM table1 ORDER BY id ) O…
1,推荐用第一种 <select id="getTeacher2" resultMap="TeacherStudent"> select s.id sid,s.name sname,t.id tid,t.name tname from teacher t,student s where s.tid=tid and tid=#{tid}</select><resultMap id="TeacherStudent" ty…
1. mysql select * from mysql-storage.mysqldb.mysqltable 2. oracle select * from oracle-storage.username.oracletable 3. mongo select * from mongo-storage.mongodb.mongocollection 4. sql server select * from sqlserver-storage.schemaname.table…