Query

How to Compare Two Tables Definition

Posted on
Compare Two Tables’ Column Names Whenever you concern the differences between two tables’ definition, you can use queries to compare the columns of two tables. For example, a table named EMPLOYEES_2 which is very similar with the original table EMPLOYEES. And we’d like to know the differences in columns. We can compare both tables like […]
Query

How to Resolve ORA-00913: too many values

Posted on
ORA-00913 Let’s see a SQL statement containing subquery that can reproduce ORA-00913 for an example. SQL> select * from employees where department_id in (select department_id, manager_id from departments where location_id = 1700); select * from employees where department_id in (select department_id, manager_id from departments where location_id = 1700)               […]
Query

How to Limit Number of Rows Returned in Oracle

Posted on
Limit Number of Rows Returned In MySQL, we use LIMIT n cluase to limit number of rows returned. In Oracle, we may need to do more works to fetch our target rows. First, we listed all sorted data like the following: SQL> conn hr/hr; Connected. SQL> select employee_id, first_name, last_name from employees order by 3; […]