vj5 Posted October 16, 2007 Share Posted October 16, 2007 I have three tables: Emp, Manager and Company Emp :empidempfnameemplnameempaddrManager:manageridmanagernamemanageraddrCompany:compidcompnamecompaddrempidmanageridSQL Join:Select * from emp, manager, companywhere emp.empid = company.empid and manager.managerid = company.compid; Can someone please let me know if my select statement is right. If it is wrong, can you give the right statement? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 16, 2007 Share Posted October 16, 2007 The SQL statement is syntactically valid, if that's what you're asking. That doesn't mean it's going to do what you want to do, but it will run. Link to comment Share on other sites More sharing options...
vj5 Posted October 16, 2007 Author Share Posted October 16, 2007 The SQL statement is syntactically valid, if that's what you're asking. That doesn't mean it's going to do what you want to do, but it will run.What do you mean by that? can you explain in detail? and also can you give some examples on joins. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 16, 2007 Share Posted October 16, 2007 I mean that it is a legal SQL statement. It might be doing something other then when you want to happen (you didn't say what the point of the query is), but the database server won't complain about it. You can get an overview of joins here:http://w3schools.com/sql/sql_join.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.