Re: help with a query

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: help with a query
Дата
Msg-id 20211115143003.GA22879@momjian.us
обсуждение исходный текст
Ответ на help with a query  (yarden tamam <tamamyarden@gmail.com>)
Ответы Re: help with a query
Список pgsql-general
Due to time constraints, I do not directly answer general PostgreSQL
questions.  For assistance, please join the appropriate mailing list and
post your question:

    https://www.postgresql.org/community

You can also try the #postgresql IRC channel on irc.freenode.net.  See
the PostgreSQL FAQ for more information.

---------------------------------------------------------------------------


On Sat, Nov 13, 2021 at 11:13:25AM +0200, yarden tamam wrote:
> i have data bast that represents basketball teams. and i'm trying to find one
> team that has not won yet but has gain that most points during their games from
> the other team who have not won yet.
> 
> i wrote a query that is checking if a team has not won at all. but i'm trying
> to figure out how to count the points because every team play either at home or
> away.
> 
> thank you for you help.
> 
> here is the query the i have wrote so far:
> select team.id, nickname,color
> from team,points,game
> where (team.tid = game.vtid and (vscore - hscore ) < 0)  or (game.htid =
> team.tid and (hscore - vscore )< 0 )
> having

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.




В списке pgsql-general по дате отправления:

Предыдущее
От: Tiffany Thang
Дата:
Сообщение: Managing major PostgreSQL upgrades
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: help with a query