Im quite new to SQL and I'm just trying to find out what it means when you use t1, t2 or t3 etc... I cant get my head around it and would just like to learn about it. I've tried looking all over google but i've found nothing yet... Can you help?
Thanks Mw
A join-condition specifies pairings of T1 and T2, where T1 and T2 are the left and right operand tables of its associated JOIN operator. For all possible combinations of rows T1 and T2, a row of T1 is paired with a row of T2 if the join-condition is true.
T-SQL (Transact-SQL) is a set of programming extensions from Sybase and Microsoft that add several features to the Structured Query Language (SQL), including transaction control, exception and error handling, row processing and declared variables.
t1/t2/t3 are common table aliases for "temp" tables (e.g. subqueries that are made of multiple tables and don't alias nicely).... call it a bit of laziness if that helps :)
SELECT * FROM MyTable t1
means from now on, I'm calling MyTable t1. Another way of writing it would be: SELECT t1.* FROM MyTable t1
or if you didn't use the alias, SELECT MyTable.* FROM MyTable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With