Re: Problem with selecting all col of one table in a join
Posted in 1997
Joe, First, I'm sure you know that useing * in the select clause is bad practice. It's use is OK as long as each column name is unambiguous. That can't happen in a join since (using your example) it can't tell which cust_code to use, from table a or s. So you say SELECT s.cust_code, ....,etc. Hope this helps Matt Townsend p.s. You might expect poor performance with that OR statement BTW. xtcpl wrote: > I am trying to do a select that of all of the columns in one table of > a > join. > > SELECT s.* > FROM strcustr s, appoehdr a > WHERE (s.cust_code = a.cust_code AND a.order_no=3453) OR > (s.cust_code = a.cust_code AND a.order_no=3455); > > Is the s.* a legal statement or do I need to enumerate all of the > columns in strcustr? > > Thanks, > Joe P