What is ‘Where 1=1, 1=2’ in Oracle SQL?

Question (Posted by Michael using Contact Form under ‘Contact US’ page):
What is the purpose of using where 1=1 and 1=2 in Oracle SQL?

Answer by TechOneStop:
Hi Michael, thank you for posting your question on our discussion forum.
In Oracle database, where 1=1 means true and 1=2 means false because 1 is never equal to 2 🙂
You could use any number like 2=3 or 3=3, only thing that matters here is both numbers are same or not. 
Let us give you an example. Suppose we have to create a table (table_b) same as another table (table_a) but do not want to copy any record from table_a, only table structure will be same for both tables. Here we can write query like below:
CREATE TABLE TABLE_B AS SELECT * FROM TABLE_A WHERE 1=2;
– This will create table_b same as table_a without copying records from table_a, only table description will be copied to table_b.

Now if we want everything from table_a will be copied to table_b, write query like below 
CREATE TABLE TABLE_B AS SELECT * FROM TABLE_A WHERE 1=1;
– This will copy table structure, all records from table_a to table_b.

Even you could use string also like ‘tech’ = ‘techonestop’ or ‘tech’=’tech’. You could use ‘where 1=1’ or ‘1=2’ in any query like SELECT COUNT(*) FROM TABLE_A WHERE 1=2; 

Please let us know if it was helpful. If you want to add more information, please feel free to comment here.