SQL Server inner join conflicting columns

zombie111

New Member
Am fixing bugs in an old classic ASP site written by another developer who has since stopped working. The following SQL command is used to call data from the database to create a table:\[code\]SELECT * FROM tblPropertyInfo INNER JOIN tblUsers on p_CustomerID = u_ID WHERE p_Paid = 0 OR p_Enabled = 0 AND p_CustomerID <> 4 ORDER BY " & orderby\[/code\]The problem is that both \[code\]tblPropertyInfo\[/code\] and \[code\]tblUsers\[/code\] contain a column \[code\]p_Type\[/code\]. In \[code\]tblPropertyInfo\[/code\], \[code\]p_Type\[/code\] stores what type of property it is and this is the value we want to display in the table however I suspect this is being overwritten by the \[code\]p_Type\[/code\] from the \[code\]tblUsers\[/code\] table which is mostly NULL values so returns empty cells in the table.I don't want to start playing with the table structures because they are used all over the site if I change it in one place will have find every single reference to it and update them all.Is there a way I can specify which table to pull the column from?Value is currently called using:\[code\]<%=rsProperty("p_Type")%>\[/code\]Thanks
 
Back
Top