Re: SQL querry - I'm a beginner

From: KnighThing <knighthing_at_hotmail.com>
Date: Fri, 01 Jun 2001 16:25:37 -0500
Message-ID: <lo1ghts8q83nkc64mnkt5hfc0dp8paivti_at_4ax.com>


Geez, you guys are harsh!

It's a news group, for sharing information and asking questions about Oracle.

If you're trying to say you can't post here unless you've got 10 years of Oracle and SQL experience then you've got issues of your own.

In regards to the question, try a group by.

SELECT player, card, count(card)
FROM table
GROUP BY player, card

Won't give you the format you're looking for, but it should give you the data you're after.

On 29 May 2001 04:36:11 -0700, curt_at_gmx.at (Christian Kuschnig) wrote:

>I'm a beginner in SQL and that' why I hope, that someone outthere could help me!!!
>
>The relation I've given is out of a soccer database an it's the following:
>
>cards(player, match, time, Karte)
>
>player is the name of the player (string)
>match is the number of the match (integer)
>time is that time, when a player gets a card (integer)
>card can have the values 'yellow', 'red', 'yellored'
>
>I've to write a querry that gives the result:
>
>(player, yellow, yellowred, red)
>
>which counts the number of the cards for each player!
>
>for example
>
>player yellow yellowred red
>
>Miller 1 0 2
>Mike 3 3 0
>Phil 0 0 1
>
>
>Thanks a lot
>
>christian
  Received on Fri Jun 01 2001 - 23:25:37 CEST

Original text of this message