This repository has been archived by the owner on Nov 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Nested select statement result set fields unnamed when using join clause #137
Labels
Comments
gernest
added a commit
to gernest/ql
that referenced
this issue
May 5, 2017
Closes cznic#137 Context cznic#136 This PR make sure the field names for results nested select are set properly. The observation from postgresql shows that for the following sql. ```sql BEGIN TRANSACTION; CREATE TABLE department ( DepartmentID integer, DepartmentName text ); INSERT INTO department (DepartmentID,DepartmentName) VALUES (31, 'Sales'), (33, 'Engineering'), (34, 'Clerical'), (35, 'Marketing'); CREATE TABLE employee ( LastName text, DepartmentID integer ); INSERT INTO employee VALUES ('Rafferty', 31), ('Jones', 33), ('Heisenberg', 33), ('Robinson', 34), ('Smith', 34), ('Williams', NULL); COMMIT; ``` ``` gernest=# select * from (select * from employee) as a,(select * from department ) as d order by d.DepartmentID desc; lastname | departmentid | departmentid | departmentname ------------+--------------+--------------+---------------- Rafferty | 31 | 35 | Marketing Robinson | 34 | 35 | Marketing Williams | | 35 | Marketing Jones | 33 | 35 | Marketing Smith | 34 | 35 | Marketing Heisenberg | 33 | 35 | Marketing Jones | 33 | 34 | Clerical Williams | | 34 | Clerical Robinson | 34 | 34 | Clerical Heisenberg | 33 | 34 | Clerical Rafferty | 31 | 34 | Clerical Smith | 34 | 34 | Clerical Smith | 34 | 33 | Engineering Jones | 33 | 33 | Engineering Williams | | 33 | Engineering Heisenberg | 33 | 33 | Engineering Robinson | 34 | 33 | Engineering Rafferty | 31 | 33 | Engineering Robinson | 34 | 31 | Sales Jones | 33 | 31 | Sales Heisenberg | 33 | 31 | Sales Rafferty | 31 | 31 | Sales Smith | 34 | 31 | Sales Williams | | 31 | Sales (24 rows) ``` Previously the names were set to empty strings .
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Details in #136 .
The text was updated successfully, but these errors were encountered: