On 10/24/07, Jim McAtee <[EMAIL PROTECTED]> wrote:
> SELECT a.*, b.*
> FROM user a INNER JOIN userprefs b ON b.userid = a.userid
> WHERE username = 'bsmith'
>
> In the query there's a common column named 'userid'. Should the query
> retun
I'd probably avoid using * in an effort to remove the ambiguity. Then
alias the column names.
SELECT
a.userID AS foo,
b.userID AS bar,
(other columns here)
FROM
...
(or, assuming they're the same value, just select one or the other,
but not both) :)
--
Charlie Griefer
================================================
"...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291997
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4