It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
相关专题:
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
开发者_开发知识库
Closed 10 years ago.
MySQL - is it legal to do 'SELECT table1.*,table2.column FROM table1,table2'?
It is legal, but it will give you a Cartesian product of the two tables. Are you sure that you want a Cartesian Product?
Most times, you would use a JOIN as in:
Select Table1.*, Table2,ColumnName
From Table1
INNER JOIN Table2
ON Table1.PKColumn = Table2.FKColumn
While this theta syntax is legal, it's just too easy to miss a join condition without the parser warning you.
精彩评论