what is the output of this query selet * from employee
where 1=2 ??
Answers were Sorted based on User's Feedback
Answer / priyanka agarwal
It will return 0 rows as 1 will never be ewual to 2
| Is This Answer Correct ? | 50 Yes | 2 No |
Answer / selvaraj v, anna university
In Oracle 10g :
---------------
no rows selected.
E.g:
----
SQL> SELECT * FROM job;
EMPNO JOBTITLE
--------- --------------------
1 Tester
2 Accountant
3 Developer
4 COder
5 Director
6 Mediator
7 Proffessor
8 Programmer
9 Developer
9 rows selected.
SQL> SELECT * FROM job WHERE 1=2;
no rows selected.
| Is This Answer Correct ? | 19 Yes | 0 No |
Answer / rohan mhatre
It will return 0 rows....since condition in where clause
will fail as 1 is not equal to 2
| Is This Answer Correct ? | 18 Yes | 1 No |
Answer / julien
indeed it will return o rows, but the goal behind is to
create a new table t2 as select * from t1 where 1=2, where
just the structure of table t1 will be copied without
copying data from table t1.
| Is This Answer Correct ? | 14 Yes | 0 No |
Answer / ashokkumar
create table temp_employee as select * from employee where 1=2;
this is only for a correct answer..
it is create from a temporary table in same table name.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / rakesh anand
In Oracle Database 10g Express Edition
it shows "no data found"
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / bhagyashree
it will return those query whose value will be 2 in first
column
| Is This Answer Correct ? | 0 Yes | 7 No |
what is sql optimization
What is indexing oracle sql?
Are subqueries better than joins?
If we update a complex view, is base table will get update ?
2 Answers Ardee Technologies, HCL,
What are the Restrictions on Cursor Variables?
What is primary key and foreign key with example?
Can I copy :old and :new pseudo-records in/to an oracle stored procedure?
What is sql and also describe types of sql statements?
Explain how can you save or place your msg in a table?
what is the difference between undefined value and null value? : Sql dba
Explain how procedures and functions are called in a PL/SQL block ?
Can we use view in stored procedure?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)