[Ur] SQL: renaming tables

Artyom Shalkhakov artyom.shalkhakov at gmail.com
Tue Mar 1 11:34:20 EST 2016


Dear all,

How to write a query that involves renaming of table vars?

For instance, I'd like to write something along the lines of:

> SELECT
>     category.CategoryID,
>     category.Title,
>     category.Slug,
>     category.ImageID,
>     category.ParentCategoryID,
>     0 AS ProductCount
> FROM category
> INNER JOIN product_of_category AS pc ON
> category.CategoryID = pc.CategoryID
> WHERE pc.ProductID = {[product_id]}

And I get:

> syntax error: deleting  SYMBOL AS

-- 
Cheers,
Artyom Shalkhakov



More information about the Ur mailing list