@XmlRootElement(name = "RequestS")
public class RequestS {
@Valid
protected Language language;
@XmlElement(type = String.class)
@XmlJavaTypeAdapter(Adapter1 .class)
@XmlSchemaType(name = "dateTime")
protected DateTime requestDateTime;
@XmlElement(required = true)
@NotNull
@Valid
protected Order order;
/**
* Getters and Setters
*/
答案 0 :(得分:1)
这只是rownum的可视化。
create table tbl_emp
( id int auto_increment primary key,
salary int not null,
key(salary) -- with few rows, not used, run thru EXPLAIN cmd to prove it
);
insert tbl_emp(salary) values (1),(2),(3),(4),(5); -- affordable employees
set @rownum:=0;
select * from
(
select @rownum:=@rownum+1 as rownum,id,salary
from tbl_emp
order by salary desc
limit 2
) xxx
where rownum=2;
+--------+----+--------+
| rownum | id | salary |
+--------+----+--------+
| 2 | 4 | 4 |
+--------+----+--------+
答案 1 :(得分:0)
可能您可以使用ORDER BY
和LIMIT
子句
SELECT
salary as secondHighest_salary
FROM
tbl_emp
WHERE dept_Id = '57'
and Date_of_joining between '2015-01-01 00:00:00' and '2015-01-01 23:59:59'
ORDER BY salary desc
LIMIT 1,2;