通过查询语句select * from user where id=1
我不知道你这个username指的是不是字段,如果是要取出表中某个字段的值。
可以通过select 字段名1,字段名2 ... from user where id=1。
-- MS sql server2005以上,ORACLE
select * from (
select row_number() over ( order by starttime asc) as rownum,* from steriworkrecord
where starttime between '2013-11-1' and '2013-12-31'
) a
where rownum between 2 and 10
-- 【注意( order by starttime asc)是你排序的方式asc升序,desc降序】
-- ORACLE还可以
select * from (
select rownum as n,* from steriworkrecord
where starttime between '2013-11-1' and '2013-12-31'
) a
where a.n between 2 and 10
-- MYSQL,postgreSQL似乎只能标量子查询
SELECT *FROM (
SELECT a.*,(
SELECT count(*) FROM steriworkrecordb WHERE b.ID<= a.ID) AS n
from steriworkrecorda
) ts
where ts.n between 2 and 10
-- 【注意b.ID<= a.ID 其中ID换成你的主键名称】
通过查询语句select * from user where id=1
我不知道你这个username指的是不是字段,如果是要取出表中某个字段的值,
可以通过select 字段名1,字段名2 ... from user where id=1
select username from user where id=1
网上还有很多数据库帮助类 里面有比较方便的写法
可以找找sqlhelper.cs
希望答案能让你满意
select username from user where id=1