tb1 has fields categories_id, categoies_code, date_added
tb2 has fields categoires_id, categories_name
$sql="select tb1.categoires_id as categories_id, tb2.* from tb1, tb2 where tb1.categories_id=tb2.categories_id"
I make the alias categories_id as tb1.categoies_id. But at the same time, I also use a wild card character to select all fields from tb2, and the tb2 also has field called categories_id.
Is this sql statment ambiguous in the field name "categories_id"? I tested it, and it is fine on my database. But I would like to know if it is legtimate if following the strict SQL standard.
I know in this case, this sql is the same as ="select tb2.* from tb1, tb2 where tb1.categories_id=tb2.categories_id".
just try to find out if "select tb1.categoires_id as categories_id, tb2.* from tb1, tb2 where tb1.categories_id=tb2.categories_id" is a legitimate sql statement. is it?
Thanks!