Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [mysql] Zapytanie z dwoma warunkami
reversend
post
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 27.07.2007

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


Mam tabelę z osobami. Jak znaleźć osobę, która ma 20 lat oraz 180cm wzrostu?
Próbowałem coś takiego:
  1. SELECT * FROM (SELECT * FROM osoby WHERE wzrost=180) WHERE wiek=20;

ale wyskakuje mi błąd:
Every derived table must have its own alias

Ten post edytował reversend 2.09.2007, 00:55:03
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
Cysiaczek
post
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Przekombinowałeś ;]

  1. SELECT * FROM osoby WHERE wiek='20' AND wzrost='180'


Pozdrawiam.


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 21.08.2025 - 05:35