Jamie Price wrote:
>
> ...which is close, but no cigar. I need to get rid of those 'blank' entries,
> plus I need to arrange it so what's left comes out like this:
>
> Quote:
> UserID: 3
> Owns Cards: 41001152
>
> UserID: 8
> Owns Cards: 41001151
>
> UserID: 9
> Owns Cards: 41001151
>
> UserID: 13
> Owns Cards: 41001151, 41001152
> UserID CardId Own Trade
> 3 41001152 1 0
> 7 41001151 0 1
> 7 41001152 0 1
> 7 41001102 0 1
> 7 41001101 0 1
> 7 41001154 0 1
> 7 41001153 0 1
> 8 41001151 1 0
> 9 41001151 1 0
> 13 41001151 1 0
> 13 41001152 1 0
SELECT o.UserID, GROUP_CONCAT(o.CardID)
FROM mycards t INNER JOIN mycards o ON t.cardid = o.cardid
WHERE t.trade = 1
AND
o.own = 1
AND
t.UserID = <cfqueryparam value="#cUserID#"
cfsqltype="cf_sql_integer">
GROUP BY o.UserID
Jochem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187258
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54