Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to alias or rename fields in YQL?

Tags:

yql

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?

like image 728
Tivac Avatar asked Nov 15 '22 09:11

Tivac


1 Answers

No, it's not possible to do an alias in the YQL query. (As @codeulike mentioned, it's really not true "SQL" like you might find in MySQL or other databases.)

One capability that might help your needs is the ability in Open Tables to create an alias for parameter names. See the YQL Open Tables documentation and search for "alias".

like image 72
BrianC Avatar answered Jan 04 '23 10:01

BrianC