Thanks. I'll take a further look at GROUP_CONCAT.
On Jun 14, 2006, at 1:16 PM, Dan Buettner wrote:
> Albert, MySQL's GROUP_CONCAT function might work for you:
> In your case something like this:
> SELECT userid, GROUP_CONCAT(value)
> GROUP BY userid
> 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.
>> Albert Padley
>> --MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe: http://lists.mysql.com/mysql?
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?