пятница, 22 ноября 2013 г.

Some new for me SQL tips.

1. We can create additional "stuff-text" columns in our query. These colunms don't exist in query tables and contain  the same text (our "stuff-text") in every row. For example (abstract select query and result.

SELECT "From", start_date, "To", fin_date FROM events_table

Column1   |   start_date   |   Column2 |   fin_date

From        |  23/11/2013 |  To            | 14/12/2013
From        |  26/11/2013 |  To            | 10/12/2013
From        |  30/11/2013 |  To            | 05/12/2013
From        |  02/12/2013 |  To            | 16/12/2013

2. Today I found excellent article about JOIN operator. In russian translate - http://www.profstat.ru/article/sql-joins.html. There is link for english source in the end of it. I copy for archive http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html .

3. There are SOME and ANY keywords in SQL. Never seen them before. Well, I think I am not going to use them... Because of IN and EXISTs - it gives me the same functionality and they are  more usual. But I needed the third item. And I need to remember this (don't really sure).


PS. English is not my native language. More over, it isn't my second language or something like that.And I haven't got any practice for ages (exclude reading some technical docs).
But it's google... I tried to navigate to some blogs around. And they are written in english. So, I am ougth to try. Hope, this will be readable.

Комментариев нет:

Отправить комментарий