| List: | General Discussion | « Previous MessageNext Message » | |
| From: | (Hal | Date: | May 19 2011 3:18am |
| Subject: | Re: Complex Query | ||
| View as plain text | |||
>>>> 2011/05/18 22:22 +0100, Mimi Cafe >>>>
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;
<<<<<<<<
You are looking for grouping (aggregating) functions. But how do your tables look? and at
first you mention two tables, but your query has three.
| Thread | ||
|---|---|---|
| • Complex Query | Mimi Cafe | 19 May |
| • Re: Complex Query | Claudio Nanni | 19 May |
| • Re: Complex Query | hsv | 19 May |
| • RE: Complex Query | Mimi Cafe | 19 May |
| • Re: Complex Query | Guido Schlenke | 19 May |
| • Re: Complex Query | Guido Schlenke | 19 May |
| • RE: Complex Query | Mimi Cafe | 20 May |
| • RE: Complex Query | Anupam Karmarkar | 20 May |
| • RE: Complex Query | Mimi Cafe | 20 May |
| • RE: Complex Query | Mimi Cafe | 20 May |
| • Re: Complex Query | Guido Schlenke | 20 May |
| • Re: Complex Query | Johan De Meersman | 20 May |
| • RE: Complex Query | Mimi Cafe | 20 May |
| • RE: Complex Query | Mimi Cafe | 20 May |
| • Re: Complex Query | Johan De Meersman | 21 May |
| • Re: Complex Query | hsv | 21 May |
| • RE: Complex Query | Mimi Cafe | 21 May |
