We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have 2 tables: A(id,name) and B(id,name,a) with a foreign key from B.a towards A.id
But I have a problem with the result of query like this: SELECT * FROM A AS A, B AS B WHERE A.id=B.a
A
B
The problem is conflict between A.name and B.name, infact in the result i get only B.name, while there isn't in the result A.name.
The text was updated successfully, but these errors were encountered:
Any suggestion/help?
Sorry, something went wrong.
Try using a proper join syntax for starters :
SELECT * FROM `LongA` AS A JOIN `LongB` AS B ON (`A`.`id` = `B`.`a`).
You should use the join() method to achieve that properly... That might look like :
db.query() .select('*') .from({A: 'LongA'}) .join({table: 'LongB', alias: 'B', conditions: 'A.id = B.a'}) .execute(callback, options);
Don't forget to try your requests on the mysql client before. It might not be node-db-mysql related here.
No branches or pull requests
I have 2 tables: A(id,name) and B(id,name,a)
with a foreign key from B.a towards A.id
But I have a problem with the result of query like this:
SELECT *
FROM
A
ASA
,B
ASB
WHERE A.id=B.a
The problem is conflict between A.name and B.name, infact in the result i get only B.name, while there isn't in the result A.name.
The text was updated successfully, but these errors were encountered: