Welcome Guest, Not a member yet? Register   Sign In
Adding Categories....table join?
#4

[eluser]Armchair Samurai[/eluser]
The x and y are aliases... I mainly use them because I'm lazy and it takes less typing, especially with more complex joins. For example, these two queries are the same:
Code:
SELECT articles.*
FROM articles
JOIN articlecategories ON articles.ID = articlecategories.articleID
JOIN categories ON articlecategories.CategoryID = categories.ID
WHERE categories.name = 'foo'

// Same query as above, but fewer keystrokes.

SELECT x.*
FROM articles AS x
JOIN articlecategories AS y ON x.ID = y.articleID
JOIN categories AS z ON y.CategoryID = z.ID
WHERE z.name = 'foo'


Messages In This Thread
Adding Categories....table join? - by El Forum - 02-09-2008, 10:06 AM
Adding Categories....table join? - by El Forum - 02-09-2008, 10:28 AM
Adding Categories....table join? - by El Forum - 02-09-2008, 12:08 PM
Adding Categories....table join? - by El Forum - 02-09-2008, 09:58 PM
Adding Categories....table join? - by El Forum - 02-09-2008, 11:04 PM
Adding Categories....table join? - by El Forum - 02-09-2008, 11:32 PM
Adding Categories....table join? - by El Forum - 02-10-2008, 12:31 PM
Adding Categories....table join? - by El Forum - 02-10-2008, 07:17 PM
Adding Categories....table join? - by El Forum - 02-10-2008, 08:04 PM
Adding Categories....table join? - by El Forum - 02-10-2008, 08:15 PM
Adding Categories....table join? - by El Forum - 02-10-2008, 08:30 PM
Adding Categories....table join? - by El Forum - 02-10-2008, 09:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB