-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
I have a table "users" whit this rows:
user_id user_name 1 Jhon 2 Paul
And other table "tests" with this rows:
test_id created_by_user_id modified_by_user_id 1 1 2
at psql shell, I send the following query:
SELECT test_id, created.user_name, modified.user_name FROM tests LEFT JOIN users as created ON tests.created_by_user_id = created.user_id LEFT JOIN users as modified ON tests.modified_by_user_id = modified.user_id
as expected, I have thr following result:
test_id created modified 1 Jhon Paul
but using pg-node whit the same query as:
const result = await client.query('SELECT test_id, created.user_name, modified.user_name FROM tests LEFT JOIN users as created ON tests.created_by_user_id = created.user_id LEFT JOIN users as modified ON tests.modified_by_user_id = modified.user_id')
in result.rows I have this:
test_id created modified 1 Jhon Jhon
Metadata
Metadata
Assignees
Labels
No labels