2016-12-20 23 views

答えて

0

あなたがmax(count(*))を使用している場合は、r.quartiere

を選択することはできません(ただし、GROUP BYのままにします)、これは動作するはずです。

select max(count(*)) 
from ristoranti r,prenotazioni p 
where p.data <'14' and p.data >'3' and r.codice=p.ristorante 
group by r.quartiere; 

これはどんな意味がありませんMAX(COUNT(*))のお願いごとquartiere

0

select r.quartiere,max(count(*)) 
from ristoranti r,prenotazioni p 
where p.data <'14' 
and p.data >'3' 
and r.codice=p.ristorante 
group by r.quartiere 
0

におけるカウントの選択最大氏は述べています。あなたは以下の

select r.quartiere, count(*) 
    from ristoranti r, 
     prenotazioni p 
    where p.data <'14' and 
     p.data >'3' and 
     r.codice=p.ristorante 
    group by r.quartiere 

を実行する場合は、quartiereごとに1つの行を取得したいです。あなたが得るカウント値は、それぞれがquartiereの最大カウントであるため、カウントは1つだけです。

これが役に立ちます。

関連する問題