![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 29 Pomógł: 0 Dołączył: 30.09.2003 Skąd: Wawa Ostrzeżenie: (0%) ![]() ![]() |
Witam, potrzebuje wyciągnąć z bazy sumę rekordów gdzie stan = 1 i stan = 4 - jednym zapytaniem
[sql:1:529de26bd0]select count(idcoś) from tabela where stan = 1[/sql:1:529de26bd0] [sql:1:529de26bd0]select count(idcoś) from tabela where stan = 4[/sql:1:529de26bd0] Wiem że trzeba tabelę złączyć i zastosować distinct ale mam zaćmienie. |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Przyjaciele php.pl Postów: 1 467 Pomógł: 13 Dołączył: 22.02.2003 Ostrzeżenie: (0%) ![]() ![]() |
[sql:1:a73659f781]select count(ilość) from tabela where pole in (1,4);[/sql:1:a73659f781]nie trzeba nic złączać i distinctować.
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 19.09.2025 - 18:39 |