December 7, 2010 at 7:55 am
Can I use the same alias for different tables within one store procedure? For example, does code below create an error?
select * from Order o inner join Customer c on c.orderid = o.orderid
select * from OrderHistory o inner join Customer c on c.orderid = o.orderid
Both tables, Order and OrderHistory are using the same alias o, is it ok?
December 7, 2010 at 7:59 am
December 7, 2010 at 8:23 am
the rule of thumb is each object in a statement must be uniquely identifyable, whether by object name or by alias;
in your example, each sql is standalone and following the rules just fine.
Lowell
December 7, 2010 at 11:48 am
Hi
There will not be problem in your query defiantly it will work, Better keep alias separately so that your code may look gud
Note: You can also have or use same alias name
Thanks
Parthi
Thanks
Parthi
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply