Hi,
select * from table where 3 > 2 what will return this query? anyone explain this query??
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shankar MPosted Dec 12, 2012, 7:08 AM
The where clause condition 3 >2 is satisfied and the query will return all the records
from the table.
We can write such query to create a table based on the existing definition of the table like,
CREATE TABLE tablex AS SELECT * FROM EMP WHERE 3 >2;
The above statement creates tablex with all the rows from the emp table. If you need to
copy only the structure of the existing table then you can query :
CREATE TABLE tablex AS SELECT * FROM EMP WHERE 1=0;
The above statement creates tablex with the definition of EMP table and with no rows.
Rohatash KumarPosted Dec 10, 2012, 10:57 PM
In where clause 3>2 condition is true. It will return all the records of the table. If you write condition 2>3. This condition is false. It will not return any record from the table only structure of the table will be display.
Blocked AccountPosted Dec 10, 2012, 10:46 PM
This query will return all the records of the table because condition is true
in where clause you have written 3>2, which is always true.