Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> informacje pobierane z 2 tabel
Strzałek
post
Post #1





Grupa: Przyjaciele php.pl
Postów: 384
Pomógł: 6
Dołączył: 11.09.2004
Skąd: Grodzisk Mazowiecki

Ostrzeżenie: (0%)
-----


Witam.

Mam 2 tabele:

artists: id, name, history, foto, telephone, email, www
productions: id, name, artist (numer id. artysty)

chciał bym jednym zapytaniem wyciągnąć

nazwę artysty, ilość wydanych płyt, oraz nazwę ostatnio wydanej płyty.

Mam nadziję że zrozumieliście problem.
Pozdrawiam Strzałek

Ten post edytował Strzałek 1.12.2005, 18:22:48
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Strzałek
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 384
Pomógł: 6
Dołączył: 11.09.2004
Skąd: Grodzisk Mazowiecki

Ostrzeżenie: (0%)
-----


zapytanie SQL:

  1. SELECT artists.id, artists.name, count( productions.artist ) AS i, t2.name
  2. FROM artists, productions, (
  3.  
  4. SELECT max( id ) AS id, artist
  5. FROM productions GROUP BY artist
  6. )t1, productions t2
  7. WHERE artists.id = productions.artist AND artists.id = t1.artist AND t1.id = t2.id
  8. LIMIT 0, 30


MySQL zwrócił komunikat:
Cytat
#1140 - Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 15:09