Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How to access inner subquery tables(Category as c and Product as p) alias in outer query.
Here is my Query;
SQL
select   p.*,p.Price,p.Quantity as TotalPrice,c.Name as CategoryName from
(
select Row_number() over (order by p.ProductId) as RowNo, p.*,p.Price*p.Quantity as TotalPrice,c.Name as CategoryName from
 Category as c
inner join Product as p
on c.ProductId=p.ProductId
) ProductCategory
Posted
Comments
Maciej Los 21-Dec-13 16:40pm    
What?
joginder-banger 21-Dec-13 22:40pm    
What you try???

1 solution

Since you aliased it as ProductCategory that is how you would access it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900