GRRR!! Column prefix does not match with table name or alias name used in the query, help!!
Posted on 2004-10-25
Hey guys / gals.. I've got this little problem that is just more annoying that anything else and i'm curious to see how I could get it fixed.... any and all help will be appreciated!
SELECT SubUser.firstName as submitted_by_firstname, SubUser.lastName as submitted_by_lastname,
ComplUser.firstName as completed_by_firstname, ComplUser.lastName as completed_by_lastname,
RE.neededBy, RE.submittedBy, RE.spacenum, RE.shoppingCenter, RE.requiredOptions,
RE.phone, RE.description, RE.tenantName, RE.devContact, RE.address, RE.city, RE.state, RE.zip
FROM request R, revision RE
inner join users SubUser ON RE.submittedBy = SubUser.userID
inner join users ComplUser ON R.completedBy = ComplUser.userID
inner join R ON RE.requestID = R.requestID
WHERE RE.revisionID = 63;
When I run the above query I keep getting this error message:
Server: Msg 107, Level 16, State 2, Line 1
The column prefix 'R' does not match with a table name or alias name used in the query.
I've gone through and double checked that I have used the appropriate alias everytime I have referred to that specific table in this query... this is really driving me nuts! I've had this happen before and I can't remember why it happens and/or how I fixed it. Just for future concern... why is this happening so I can avoid this? I know it's probably something small!