tags:

views:

31

answers:

1

I'm making a bunch of YQL queries at once & have a standard way of accessing the fields on the server. Unfortunately one of the feeds uses a different name than the rest for a field so I was assuming I could alias it within YQL.

Something like:

SELECT title, link, encoded AS description FROM...

But it looks like YQL's parser doesn't like that as I get this error:

Syntax error(s) [line 1:37 expecting field got 'AS']

So, is it possible to alias fields in YQL like you can in SQL? I don't seen anything in the YQL docs or on the internet at large.

Tacking another (small) question on as well, is there a spec anywhere for YQL's syntax?

A: 

I think YQL corresponds to SQL in only a metaphorical sort of way; although it superficially uses things like SELECT, it doesn't try to cover much of the breadth of SQL. Hence if its not in the documentation, its probably not possible.

In this guide: http://developer.yahoo.com/yql/guide/select_statement.html ... aliasing of fields is not mentioned, so I figure its not a feature.

Although, if you run your YQL query through Yahoo Pipes, you can use their Rename module to rename elements of the data.

codeulike