MySQL Forums
Forum List  »  Newbie

Re: Confused as to why this sql statement is not working
Posted by: Barry Galbraith
Date: February 02, 2019 12:42AM

Quote

('x-' + B.id)

In SQL '+' is an arithmetic operator meaning 'add'

If you want to concatenate, then you need concat()
https://dev.mysql.com/doc/refman/8.0/en/string-functions.html#function_concat

Also, the order of evaluation of SQL is not quite what you think. The FROM clause is actually evaluated before the SELECT, so CID doesn't exist here
inner join B on A.xid = CID

You'll need to specify the ON condition in terms of a field in A and a field in B
from A 
inner join B on A.xid = B.some_field

Good luck,
Barry.

Options: ReplyQuote


Subject
Written By
Posted
Re: Confused as to why this sql statement is not working
February 02, 2019 12:42AM


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.