hello,
I am embarking on new territory by advancing my skills in mysql.
I am currently working with LEFT JOIN, but while I was working on example, I noteced that the example was almost renaming the table while running the query...see the following...
My database has the following tables
company category company.category
the mySQL query looked like this:
SELECT ct.name FROM category ct
LEFT JOIN company_category cc ON ct.id = cc.category_id
LEFT JOIN company c ON cc.company_id = c.id
WHERE c.id = 2
so, this snippet: category ct
and this: ct.name
whats up with that? Where does the CT come in to play?
mysql help
Moderator: General Moderators
Re: mysql help
table category.... ALIAS/SHORT NAME ctflapjack wrote:SELECT ct.name FROM category ct
LEFT JOIN company_category cc ON ct.id = cc.category_id
LEFT JOIN company c ON cc.company_id = c.id
WHERE c.id = 2
table company_category .... ALIAS/SHORT NAME cc
and so on....
Re: mysql help
THanks alot. So simple.
I was assuming that was what it was, but didn't want to mess it up in a job interview.
I was assuming that was what it was, but didn't want to mess it up in a job interview.