datacamp / antlr-plsql

GNU Affero General Public License v3.0
17 stars 14 forks source link

support for case when and subqueries #26

Closed colinricardo closed 5 years ago

colinricardo commented 7 years ago

Currently code with CASE..WHEN or subqueries in them seem to produce Unshaped nodes.

Case When Example

SELECT name, continent, code, surface_area,
    CASE WHEN surface_area > 2000000 THEN 'large'
       WHEN surface_area > 350000 THEN 'medium'
       ELSE 'small' END AS geosize_group
FROM countries;

Subquery Example

SELECT local_name, subquery.lang_num
FROM countries,
  (SELECT code, COUNT(*) AS lang_num
   FROM languages
   GROUP BY code) subquery
WHERE countries.code = subquery.code;

cc @ismayc

machow commented 7 years ago

I'll be gone Thurs and Friday, but will add it to the queue of things!