List:General Discussion« Previous MessageNext Message »
From:Claudio Nanni Date:May 19 2011 9:42am
Subject:Re: Complex Query
View as plain text  
Hint:

   - group_concat
   - group by
   - having count(*)>1

Cheers

Claudio


2011/5/18 Mimi Cafe <mimicafe@stripped>

> Hi
>
> I am trying to retrieve record from 2 tables (book and author), but my
> problem is how to retrieve all the names of authors where more than one
> author wrote a book.
>
> Here is what i have: it works OK, except that it returns more than one row
> for books that have more than one author.
>
> select concat(fname,' ',initial,' ',lname) from author inner join
> book_author on fkauthor_id = pkauthor_id inner join book on fkisbn =
> pkisbn;
>
> Any idea who can formulate my query to retrieve the books with with names
> of
> all the authors concatenated in one?
>
>
> Mimi
>



-- 
Claudio

Thread
Complex QueryMimi Cafe19 May
  • Re: Complex QueryClaudio Nanni19 May
  • Re: Complex Queryhsv19 May
RE: Complex QueryMimi Cafe19 May
  • Re: Complex QueryGuido Schlenke19 May
  • Re: Complex QueryGuido Schlenke19 May
    • RE: Complex QueryMimi Cafe20 May
      • RE: Complex QueryAnupam Karmarkar20 May
        • RE: Complex QueryMimi Cafe20 May
          • RE: Complex QueryMimi Cafe20 May
            • Re: Complex QueryGuido Schlenke20 May
              • Re: Complex QueryJohan De Meersman20 May
                • RE: Complex QueryMimi Cafe20 May
                  • RE: Complex QueryMimi Cafe20 May
                  • Re: Complex QueryJohan De Meersman21 May
                    • Re: Complex Queryhsv21 May
                      • RE: Complex QueryMimi Cafe21 May