List:General Discussion« Previous MessageNext Message »
From:Albert Padley Date:June 14 2006 8:01pm
Subject:Re: Problem With Join Syntax
View as plain text  
Dan,

Thanks. I'll take a further look at  GROUP_CONCAT.

Albert


On Jun 14, 2006, at 1:16 PM, Dan Buettner wrote:

> Albert, MySQL's GROUP_CONCAT function might work for you:
> http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html
>
> In your case something like this:
> SELECT userid, GROUP_CONCAT(value)
> GROUP BY userid
>
> HTH,
> Dan
>
>
> Albert Padley wrote:
>> I have the following table schema in MySQL 4.1.18 which I didn't  
>> create, but have to work with.
>> CREATE TABLE `phplog_userinput` (
>>   `id` int(11) NOT NULL auto_increment,
>>   `inputfieldid` int(11) NOT NULL default '0',
>>   `userid` int(11) NOT NULL default '0',
>>   `value` varchar(150) NOT NULL default '',
>>   PRIMARY KEY  (`id`)
>> ) ENGINE=MyISAM DEFAULT CHARSET=latin1
>> A typical set of data looks like this:
>> id | inputfieldid | userid | value
>> 1          1           2     John
>> 2          2           2     Smith
>> 3          3           2     name@stripped
>> I am trying to come up with a query to return all the `values` of  
>> a single userid in a single row. I've checked my books, the manual  
>> and tried every type of join I can think of without success. I'd  
>> appreciate some direction.
>> Thanks.
>> Albert Padley
>> --MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe:    http://lists.mysql.com/mysql? 
>> unsub=danb@stripped
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql? 
> unsub=apadley@stripped
>

Thread
Problem With Join SyntaxAlbert Padley14 Jun
  • Re: Problem With Join SyntaxChris White14 Jun
    • Re: Problem With Join SyntaxKeith Roberts15 Jun
      • Re: Problem With Join SyntaxAlbert Padley15 Jun
  • Re: Problem With Join SyntaxDan Buettner14 Jun
    • Re: Problem With Join SyntaxAlbert Padley14 Jun