help with a query

From: yarden tamam <tamamyarden(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: help with a query
Date: 2021-11-13 09:13:25
Message-ID: CAFp5-xymsRnvtSnArH9Y69c+-MwKRcfmZsR+pSGH34xHUH11Lw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Дмитрий Иванов 2021-11-14 10:10:32 pg_restore depending on user functions
Previous Message Hilbert, Karin 2021-11-12 23:55:45 How to Implement DR for a Production PostgreSQL v12.8 database cluster with repmgr & PgBouncer?