Unknown column on 'on clause' in sql joins? -
can guys help me please in understanding sql specifications on join. don't understand it. kept getting errors called unknown column list on on clause. got error on sql syntax, rubbed in face can't understand why not working, have read article regarding because of precedence etc confused on have done wrong here.
select product.name , product.price product inner bring together product_category on (product_category.product_no = product.product_no ) product_category.sub_category = "coffin";
i know question have been inquire hudred , 1000000 times here, ones saw complicated close in basic sql syntax.
thanks helping me out.
edit: had realize have product_category not direct kid product table have typed
select * product bring together specifications bring together product_category on ( specifications.product_no = product_category.product_no);
but still gave me error, unknown column product_category.
i've read , followed instruction sites: mysql unknown clause bring together column in next join unknown column {0} in on clause mysql "unknown column in on clause"
i frustrated. can't work.
for each new table bring together in query, each table must have @ to the lowest degree 1 on clause. it's hard know you're trying without knowing schema (table names, columns, etc), here's example
select * product p bring together specifications s on p.product_no = s.product_no bring together product_category pc on pc.spec_no = p.spec_no
check out link on table aliases well. gives illustration on joins + useful info on how increment readability of sql http://msdn.microsoft.com/en-us/library/ms187455(v=sql.90).aspx
i found article useful visually displays different types of joins http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html
sql
No comments:
Post a Comment