Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> group by problem
Hi there.
I have a question to a sql problem.
I have a two tables, one is called hardware, the other is called
location.
in hardware I have several columns where one is called node which contains the MAC-address of a host.
I now have to get a list of all the hosts which have a MAC-address which is used more than once ...
If I do a
select * from (
select node, count(node) as anzahl from ams.hardware group by NODE
)
where anzahl > 1
I get all the MAC addresses which are used more than once ... but I need the hostsnames and other information out of it .. I tried:
select * from (
select h.NODE, h.HOSTNAME, l.ORT, count(h.node) as anzahl from ams.hardware h, ams.LOCATION l group by h.node where h.LOC_RECNO = l.STANDORT_NR (+) ) where anzahl > 1
but this does not work .. it says that the right ) is missing ....
I need hardware.Node, hardware.Hostname, location.Ort from all Nodes which have an MAC-Address in hardware.Node which occurs more than once in the table.
can someone help me how to achieve this?
thanks
-- mfg Marc EggenbergerReceived on Wed Apr 30 2003 - 04:38:37 CDT
![]() |
![]() |