查询一个用户有几张表? 都有那些表?在什么用户下输入什么命令? 用户的表数目: SQL> select table_name from all_tables t where t.owner='SYS' and rownum <=5;TABLE_NAME ------------------------------ ACCESS$ ALERT_QT APPLY$_CONF_HDLR_COLUMNS APPLY$_CONSTRAINT_COLUMNS APPLY$_DEST_OBJSQL>表连接有左外连接,右外连接,自然连接 左连接 select e.* from emp e left join employee p on e.id = p.id
--scott用户 conn scott/tiger; select TABLE_NAME from user_tables;多表查询有:in,not in,exists,not exists,left join,right join,>,=,<,union等等举例: select count(*) from emp,dept where emp.deptno = dept.deptno;
查询一个用户有几张表? 都有那些表?在什么用户下输入什么命令?
用户的表数目:
SQL> select table_name from all_tables t where t.owner='SYS' and rownum <=5;TABLE_NAME
------------------------------
ACCESS$
ALERT_QT
APPLY$_CONF_HDLR_COLUMNS
APPLY$_CONSTRAINT_COLUMNS
APPLY$_DEST_OBJSQL>表连接有左外连接,右外连接,自然连接
左连接
select e.* from emp e left join employee p on e.id = p.id
conn scott/tiger;
select TABLE_NAME from user_tables;多表查询有:in,not in,exists,not exists,left join,right join,>,=,<,union等等举例:
select count(*) from emp,dept where emp.deptno = dept.deptno;
都能举个例子嘛? 非常感谢