List:General Discussion« Previous MessageNext Message »
From:Keith Roberts Date:June 14 2006 9:59pm
Subject:Re: Problem With Join Syntax
View as plain text  
Hi Chris.

I cannot see how it can be done with the current table 
schema. Maybe you need to redeclare your table so the values 
in the value column are more distinct?

What is value supposed to contain anyway? First name, last 
name and email address?

What about a structure like:

id | userid | ipf_1 | ipf_2 | ipf_3 
1      2     John    Smith   email_addy

Which will allow you to retrieve all the values you want 
from the table as one row without having to repeat the 
userid column?

HTH

Keith Roberts

In theory, theory and practice are the same;
in practice they are not.

On Wed, 14 Jun 2006, Chris White wrote:

> To: mysql@stripped
> From: Chris White <chriswhite@stripped>
> Subject: Re: Problem With Join Syntax
> 
> On Wednesday 14 June 2006 10:55 am, Albert Padley wrote:
> > 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.
> 
> This sounds like somewhat of a strange requirement.  Why do they need to be in 
> a single row?  There MIGHT be a way to do it with stored procedures, I'm just 
> not sure how..
> 
> > Thanks.
> >
> > Albert Padley
> 
> -- 
> Chris White
> PHP Programmer/DB Fighter
> Interfuel
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
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