Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

The FROM clause

SELECT table1.whatever,
  FROM table1, LATERAL ( table-expression ) AS table2 

works as if it was coded as an INNER JOIN with special LATERAL properties... rows in table1 that don't match rows in table2 are excluded from the result set.

LATERAL is very cool (and fast), but so is LEFT OUTER JOIN.

asked 15 May '21, 07:48

Breck%20Carter's gravatar image

Breck Carter
accept rate: 20%

I'd use OUTER APPLY here, and CROSS APPLY for inner joins, see here... - and particularly Glenn's older blog article - those were the days...

permanent link

answered 15 May '21, 11:17

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

converted 17 May '21, 11:19

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 15 May '21, 07:48

question was seen: 1,022 times

last updated: 17 May '21, 06:59