Skip to content

Update _dml-40.adoc #167

New issue

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

Merged
merged 1 commit into from
Dec 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/docs/asciidoc/en/rlsnotes/rlsnotes40/_dml-40.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ The feature is defined in (SQL:2011): 7.6 <table reference> (Feature T491).
.Examples
[source]
----
/* select customers with they last order date and number */
select c.name, ox.order_date as last_order, ox.number
from customer c
left join LATERAL
(
select first 1 o.order_date, o.number
from orders o
where o.id_customer=o.id

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not c.id instead of o.id?
where o.id_customer = c.id

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I had overlooked that. Fix is underway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in df16def, thanks for reporting.

order by o.ORDER_DATE desc
) as ox
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The join is missing an ON or USING clause

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yes please fix it ON 1=1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used on true which does the same

----
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

---- ends the current source block, and this breaks the rest of the document, because the remainder of the example is outside the current source block (and then starts a new one).

Replace with -- (as used between the queries in the original example).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not find markup definition yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select dt.population, dt.city_name, c.country_name
from (select distinct country_name from cities) AS c,
LATERAL (select first 1 city_name, population
Expand Down