请问 查询table 表中 name相同的 字段 可否以这条语句
select * from table t1,table t2 where t1.id<>ti.id and t1.username=t2.username这条语句能执行正确吗?请问还有其他语句吗
select * from table t1,table t2 where t1.id<>ti.id and t1.username=t2.username这条语句能执行正确吗?请问还有其他语句吗
解决方案 »
- ORACLE11g 我做了Create pfile from spfile;操作后,就无法找到SID了
- 怎样使用动态SQL???
- 奇怪问题,plsql能连接,服务端却不能连接
- 这种情况下从表中取数,where条件应该如何写,谢谢指教
- 64位Win7上如何同时安装oracle 11g和10g
- 请教一个sql语法问题
- oracle的服务都启动了,为什么连不上oracle服务器?请各位帮帮忙阿!十万火急阿!!!
- 怎样才能把表删掉?
- ==各位大虾:要是不知道Oracle的服务名(SID)从哪里能找到???在线等待===
- table A、B, B比A多一个字段 FFF,怎样将A中的数据都转到B中,并给FFF赋值?
- oracle 10g 安装成功后 无法启动
- 关于ORCLE数据库统计问题,高手帮帮忙!~~
这样写可以啊!!这样写不错,但是你把T2写成了ti了。。改一下就好了!select * from table t1,table t2 where t1.id <>t2.id and t1.username=t2.username
select * from table t1,table t2 where t1.id <>t2.id and t1.username=t2.username
是可以的,还可以用select * from (select table.*, count(1) over(partition by name) cnt from table) where cnt < 1;
改一下
select * from (select table.*, count(1) over(partition by name) cnt from table) where cnt = 1;