Hi All, first off let me preface this posting by saying I am an Access guy who is still learning how to do some things in Oracle.. and therein lies my issue. Any help or suggestions would be greatly appreciated. I’m assuming something along these lines is possible, right??
I have a table Analysis, with has an NMBR_TRIP field and TRIPID Field. What I want do is simply populate the NMBR_TRIP field with the count of TRIPID.
The Access solution is fairly simple
UPDATE ANALYSIS SET NMBR_TRP = DCount("*","SPECIES_02_03","TRIPID=" & [TRIPID]);
And the Select query in Oracle seems to be easy
SELECT ANALYSIS.TRIPID, Count(*) AS Freq
FROM ANALYSIS
GROUP BY ANALYSIS.TRIPID;
However I want to embed that aggregate query above in an UPDATE query and I’m having problems with it.
My best guess (which doesn’t work) is something along these lines
update a
set NMBR_TRIP = FREQ
from Analysis A join
(SELECT ANALYSIS.TRIPID, Count(*) AS Freq
FROM ANALYSIS
GROUP BY ANALYSIS.TRIPID) S
on A.tripid = s.tripid
Thx
-eric
I have a table Analysis, with has an NMBR_TRIP field and TRIPID Field. What I want do is simply populate the NMBR_TRIP field with the count of TRIPID.
The Access solution is fairly simple
UPDATE ANALYSIS SET NMBR_TRP = DCount("*","SPECIES_02_03","TRIPID=" & [TRIPID]);
And the Select query in Oracle seems to be easy
SELECT ANALYSIS.TRIPID, Count(*) AS Freq
FROM ANALYSIS
GROUP BY ANALYSIS.TRIPID;
However I want to embed that aggregate query above in an UPDATE query and I’m having problems with it.
My best guess (which doesn’t work) is something along these lines
update a
set NMBR_TRIP = FREQ
from Analysis A join
(SELECT ANALYSIS.TRIPID, Count(*) AS Freq
FROM ANALYSIS
GROUP BY ANALYSIS.TRIPID) S
on A.tripid = s.tripid
Thx
-eric