Re: Column aliases
Russ Tyndall <
russ@...>
2012-04-30 14:38:14 GMT
Hello,
There is not an easy syntax way of creating aliases (yet),
though good / reasonable patches for this would be accepted. You will
also have better luck if you include what backend(s) you are having
issues with.
* [response_date date] will create the column name response_date.date
* You can check the output of a sql expression by calling
(clsql-sys:sql [response_date date] )
* You can always ensure that your exact desired output is emitted by
using the sql-expression :string function. This is probably the easiest
path.
(clsql-sys:sql-expression :string "response_date as date")
* You *could* use a sql-ident-table directly though this is the wrong
type and I cannot guarantee it would work in all forms, and it is not
supported by the syntax either. This seems unideal, but might solve your
issue
eg>(clsql-sys:sql
(clsql:sql-expression :table "foo.response_date" :alias "date" ))
=> "\"foo.response_date\" \"date\""
* You could use clsql:query instead and enter the whole query as a
string
* This form seems like it should work, but doesnt (because it creates an
(Continue reading)