Sunday, October 9, 2011
Saturday, October 8, 2011
[SQL] JOIN
http://www.firebirdfaq.org/faq93/
What's the difference between LEFT, RIGHT, INNER, OUTER, JOIN?
The difference is in the way tables are joined if there are no common records.
JOIN is same as INNER JOIN and means to only show records common to both tables. Whether the records are common is determined by the fields in join clause. For example:
FROM t1
JOIN t2 on t1.ID = t2.ID
means show only records where the same ID value exists in both tables.
LEFT JOIN is same as LEFT OUTER JOIN and means to show all records from left table (i.e. the one that precedes in SQL statement) regardless of the existance of matching records in the right table.
RIGHT JOIN is same as RIGHT OUTER JOIN and means opposite of LEFT JOIN, i.e. shows all records from the second (right) table and only matching records from first (left) table.
JOIN is same as INNER JOIN and means to only show records common to both tables. Whether the records are common is determined by the fields in join clause. For example:
FROM t1
JOIN t2 on t1.ID = t2.ID
means show only records where the same ID value exists in both tables.
LEFT JOIN is same as LEFT OUTER JOIN and means to show all records from left table (i.e. the one that precedes in SQL statement) regardless of the existance of matching records in the right table.
RIGHT JOIN is same as RIGHT OUTER JOIN and means opposite of LEFT JOIN, i.e. shows all records from the second (right) table and only matching records from first (left) table.
-------------------------------------------------------------------------------
These 3 mysql queries have the same results
mysql> SELECT name FROM animal LEFT JOIN animal_food ON animal.id=animal_id WHERE animal_id IS NULL;
mysql> SELECT name FROM animal WHERE NOT EXISTS (SELECT animal_id FROM animal_food WHERE animal.id=animal_id);
Friday, October 7, 2011
Eclipse Switching Tabs
Alternating File Tabs by pressing Ctrl + TAB
Even with many files open in the eclipse editor, only two files can be navigated alternatingly by Ctrl + TAB
To configure
Windows -> Preferences -> General -> Keys
1. Unbind "Next Tab"
Eclipse says that "Next Tab" is Switch to the next tab which I have no knowledge about
Type in Next Tab to locate Next Tab and click on Unbind Command
2. Bind "Next Ed"
Find it and bind a new command with "Ctrl + Tab"
Two things will be noticed
1. While holding the Ctrl key, if the TAB key is pressed, then the previously worked file will be focused
Let go off the Ctrl + TAB, and doing it again will focus on the previous file again
So only two files will be alternatingly navigated without being bothered by others which are still open
If a file tab is mouse-clicked, then it will become the current tab as if it was selected by Ctrl + Tab
2. If the Ctrl key is still being pressed, many TAB keys will navigate the files in the order they file names are buffered
* The alternating navigation between just the two files has nothing to do with "Previous Editor"
Even with many files open in the eclipse editor, only two files can be navigated alternatingly by Ctrl + TAB
To configure
Windows -> Preferences -> General -> Keys
1. Unbind "Next Tab"
Eclipse says that "Next Tab" is Switch to the next tab which I have no knowledge about
Type in Next Tab to locate Next Tab and click on Unbind Command
![]() |
Unbind Next Tab |
2. Bind "Next Ed"
Find it and bind a new command with "Ctrl + Tab"
![]() |
Bind Next Editor |
Two things will be noticed
1. While holding the Ctrl key, if the TAB key is pressed, then the previously worked file will be focused
Let go off the Ctrl + TAB, and doing it again will focus on the previous file again
So only two files will be alternatingly navigated without being bothered by others which are still open
If a file tab is mouse-clicked, then it will become the current tab as if it was selected by Ctrl + Tab
2. If the Ctrl key is still being pressed, many TAB keys will navigate the files in the order they file names are buffered
* The alternating navigation between just the two files has nothing to do with "Previous Editor"
![]() |
Bind Next Editor |
Subscribe to:
Posts (Atom)