MySQL Forums
Forum List  »  Newbie

Re: SQRT / Pythagoras Query problem
Posted by: Peter Brawley
Date: May 15, 2014 11:54AM

Names must disambiguate perfectly. If sproc param names are also column names and/or alias names, how in the world is MySQL supposed to figure out which any reference refers to?

Either lose the BEGIN/END (because it's just one statement), or add DELIMITER directives.

> from loc a, loc b, loc b where a.loc=c.loc

cross joins that to b. Surely that isn't optimal.

And since names should disambiguate perfectly, it's usually a bad idea to use a table name as a column name (loc).

Forget comma joins. Write joins out explicitly using the JOIN keyword. See the manual page for Joins.

> WHERE b.Loc = <b_name value>'

if p_val is a parameter carrying a value to be compared, write:

WHERE b.loc=p_val.

Options: ReplyQuote


Subject
Written By
Posted
Re: SQRT / Pythagoras Query problem
May 15, 2014 11:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.