asheshsaraf / squiggle-sql

Automatically exported from code.google.com/p/squiggle-sql
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Support for column aliases #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently we can't create select's with column aliases, like in

SELECT 
  p1.name as son, 
  p2.name as dad 
FROM
  PEOPLE p1,
  PEOPLE p2
WHERE
  p1.parentId = p2.id

Column aliases are useful when using the same table multiple times. 

The attached file is a patch to SelectQuery for supporting Column aliases.

Actually, aliases are supported on all kind of Selectables, which will only 
cause a problem when someone tries to alias the WildCardColumn. Empty aliases 
will also create broken queries.

Original issue reported on code.google.com by brunoabdon on 6 Aug 2010 at 4:39

Attachments:

GoogleCodeExporter commented 8 years ago
An additional patch with unit test

Original comment by javaj...@gmail.com on 12 Jun 2012 at 2:56

Attachments: