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.

What is Caret Browsing ( or Caret Navigation) ?

Have you heard about Caret Browsing? This is quite old technical term but if you are not keyboard savvy person, you would not be familiar with caret browsing or caret navigation.
Like most of the people, you probably use mouse to select text on a webpage during internet browsing and just for typing purpose, you use keyboard. But what would you call it, if you can select text on a webpage by using keyboard only? This is what we call as called Caret Browsing or Caret Navigation where a caret (also known as ‘text cursor’ or ‘text insertion cursor’ or ‘text selection cursor) is used to navigate within webpage, same as Microsoft Word. But this feature is not supported by all browsers, Internet Explorer and Mozilla Firefox support Caret Browsing.
To enable or disable Caret Browsing on a webpage, just press ‘F7’ function key. It will prompt you to turn Caret Browsing on, press ‘Yes’ and Caret Browsing will be enabled. Now you can use various navigation keys on your keyboard including ‘Home’, ‘End’, ‘Page Up’, ‘Page Down’, 4 arrow keys to select text, hold ‘Shift’ key and move the caret to select multiple lines. Almost it looks like a cellphone browser, quite useful when you are using laptop touchpad rather than a mouse.

To enable caret browsing in Internet Explorer and Mozilla Firefox:
– Press F7 function key and then click ‘Yes’ on the popup window

What is Caret Browsing - techonestop.com


– To enable Caret Browsing for new window and tabs (only for Internet Explorer), click on ‘Tools’ (‘Gear’ icon on top right hand corner), go to Internet Options > Advanced and mark the check box ‘Enable Caret Browsing for new windows and tabs‘ true.

Caret browsing - techonestop.com

To disable Caret Browsing, press F7 again. If the checkbox ‘Enable Caret Browsing for new windows and tabs‘ is marked, uncheck it.

For more updates on recent activities, follow ‘TechOneStop‘ on Facebook / Twitter / LinkedIn or join our website as follower.

Use of Keyboard Function keys (F1 – F12)

Keyboard Function keys or fn keys (f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12)

Every keyboard comes with a set of function keys (F1 through F12) but do you know functionalities of those function keys (or fn keys)? Sometimes in multimedia keyboard or compact keyboard, these function keys come as secondary functions on other keys like brightness, sleep, play media, player, mute. In such keyboard, to use function keys, you may need to press another special key ‘fn’ (beside Windows key) and then any function key. These function keys can be used with combination of other keys like ctrl or alt or shift.
Each function key is built to perform specific task but it may vary based upon operating system and the kind of program you are using right now. Let’s see few common functionalities that can be performed using these function keys. Few of such functionalities you may have used, few not.


F1:  
   – Almost every program uses this key to open its Help and Support window 
   – F1 with windows key shows up Windows Help and Support screen
   – Can be used to enter CMOS setup

F2:
   – Yes, I know, almost everyone has used this to rename files or folders or icons quickly
   – Can be used to enter CMOS setup
   – Alt + Ctrl + F2 opens document window in Microsoft Office
   – Ctrl  + F2 displays print preview window in Microsoft Office
   – Alt + F2 opens ‘Save As’ window in Microsoft Excel
   – Shift + F2 can be used to add comment box in Microsoft Excel

F3:
   – Press F3 to open search window to find files and folders
   – In MSDOS or windows command prompt, F3 repeats the last command
   – On most browsers, F3 is used to open find bar
   – In Microsoft Word, Shift + F3 changes the text from upper case to lower case or all capital letters

F4:
– Most common, Alt + F4 to close current program window. If no program window is open, it launches Shutdown dialog box
– Ctrl  + F4 closes active window within current active window in Microsoft Windows
– Opens address bar in Windows Explorer and Internet Explorer
– Press F4 to repeat the last action performed in Microsoft Word

F5:
   – Almost in all modern internet browsers, pressing F5 refreshes or reloads the web page
   – Starts slide show in Power Point
   – Opens Find and Replace window in Microsoft Word, GoTo window in Excel

F6:
   – Almost in all modern browsers, pressing F6 moves the cursor to the address bar
   – Ctrl + F6 toggles between various Microsoft Word documents

F7:
   – Press F7 to launch Spelling and Grammar dialog box in Microsoft Office program
   – Shift + F7  opens Research window in Microsoft Office
   – In few browsers like Internet Explorer, Mozilla Firefox, pressing F7 turns Caret Browsing on or off

F8:
   – Holding F8 during Windows boot process enters into Windows Safe Mode
   – Pressing F8 displays a thumbnail image of all workspaces in Mac OS X

F9:
   – In many application, it is used to send email like Microsoft Outlook, Siebel CRM
   – Ctrl + F9 and Alt + F9 are used to build mail merge document in Microsoft Word
   – If you are a programmer, you may have used F9 to compile and execute code in combination with Ctrl or Alt key

F10:
   – In many programs, Shift + F10 opens up the menu window, equivalent to right-click
   – Shows menu bar in Mozilla Firefox, internet browser or highlights the same in many programs
   – Sometimes it is used to enter CMOS setup

F11:
   – Is used to enter and exit from full screen mode in all modern internet browsers
   – In Microsoft Excel, Shift + F11 adds a new sheet, Ctrl + F11 adds a new macro to the workbook
   – Pressing Alt + F11 in MS Office program, invokes Microsoft Visual Basic window for that document

F12:
– Opens ‘Save As’ window in MS Office program
– Shift + Ctrl + F12 open Print window in MS Office
– Ctrl + F12 opens a document in MS Office
– Opens and closes developer tools in most of the internet browsers

Conclusion:
In earlier IBM keyboard, there were keys from F13 to F24 also. But we do not use these function keys any more. We have tried our best to give you functionalities of all Function keys or fn keys (F1 – F12). But we may have missed out some important uses of these function keys and that’s what we have readers like you. Please let us know if you have come across any other functionalities of these function keys. We will publish it with your name.
For more updates on recent activities, follow ‘TechOneStop‘ on Facebook / Twitter / LinkedIn or join our website as follower.

To know more, watch our YouTube video: