Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Dilemma!! Anyone.........
hallian_at_hotmail.com schrieb:
> Hi SQL[ers],
>
> Is this possible to do in SQL with just my 2 tables:
> First Table: users
> Second Table: log
>
> USERS TABLE [1 FIELD] name
> sam
> john
> jack
> miller
>
> LOG TABLE [3 FIELDS] rec_no name desc
> 1 sam happy
> 2 jack unhappy
> 3 sam jolly
> 4 miller happy
> 5 sam smiley
> 6 john unhappy
>
> Now can I use SQL statements to loop through each entry from Table:
> USERS against each entry against Table: LOG. Is it possible!!!!
>
> sam 3 entries
> jack 1 entry
> miller 1 entry
> john 1 entry
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
select l.name, count(*)
from
log l,
users u
where l.name = u.name
group by l.name;
Regards, Stephan
--
Dipl.-Inf. (FH) Stephan Born | beusen Consulting GmbH fon: +49 30 549932-0 | Landsberger Allee 392 fax: +49 30 549932-29 | 12681 Berlin mailto:stephan.born_at_beusen.de | Germany --------------------------------------------------------------- PGP-Key verfügbar | PGP-Key available ---------------------------------------------------------------Received on Fri Dec 10 1999 - 01:51:24 CST
![]() |
![]() |