表数据
time nvarchar(20)
2010-5-6
2010-5-7
2010-5-8
2010-5-10
2010-5-11
把>= 2010-5-10 的那两个数据读出来
由于不是dataTime类型,进行的是字符串的比较.
SQL code:
select * from t1 where 时间 >= '2010-5-10'
select * from t1 where CONVERT(varchar,时间,120) >= '2010-5-10'
......
一共两列
id time
1 201009
2 201009
3 201009
1 201009
1 201009
2 201009
4 201009
求,,某一时间点击量最大的id号?(oracle)
select time,max(id) from tablename
group by time
SQL code:
select id,time,max(id) keep(dense_rank last order by count(*)) 最大id
from tb
where ......
create table user_b.abcd
( a number constraint abc_pk primary key
using index
(create index abc_index on user_b.abcd(a) tablespace users),
b number
);
------------------
SQL> @h:\code\6.sql
(create index abc_index on user_b.abcd(a) tablespace users),
......
各位大神 我在编写运行分页的时候 怎么说我的SQL语法错误
代码是
rs = st.executeQuery("select top "+pageSize+" *from users where userId not in (select top "+pageSize*(pageNow-1)+" userId from users) ");
错误贴出来晒晒啊。还有你用的数据库是什么数据库啊,应该是Oracle的吧 ......
sqlserver中的 xml有什么用啊
好像老看到什么xml
但我怎么没用到啊?
xml应该是用在web中的吧
我怎么没碰到过
什么样的情况应该使用他
你把web中的xml保存在数据库中 就可以用
呵呵 只是方便生成xml文件吧,使用的话需要前端web解析器
在服务器端动态输出 xml 数据吗?
关注.
可以直接输出到html页面上
......
表A
name id parentid sortnum
aa 1 7 1
bb 2 7 2
cc 3 7 3
dd 4 8 1
ee 5 8 2
ff 6 8 3
gg 7 1
hh 8 2
请问如何写sql语句,排序后得到如下结果:
......