Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Complex Query
>>>>> "Michael" == Michael Hill <hillmw_at_ram.lmtas.lmco.com> writes:
Michael> I have a couple tables, i.e table one fielda fieldb fieldc
Michael> table two fielda fieldd
Michael> I need to be able to count the number of 'd's in table two Michael> and display along with the query from table one, something Michael> like:
Michael> select fielda,fieldb,fieldc, sum(fieldd) from one a, two b Michael> where a.fielda=b.fielda
Michael> Anyone know how I'd so this? Should the sum(fieldd) be a Michael> view?
select fielda, fieldb, fieldc, count(fieldd)
from tabel1 a, table2 b
where a.fielda = b.fielda
group by fielda, fieldb, fieldc;
-- Tim Cross The e-mail address on this message is FALSE (obviously!). My real e-mail is to a company in Australia called rapttech and my login is tcross - if you really need to send mail, you should be able to work it out!Received on Sat Mar 22 2003 - 03:14:15 CST