Dear community,
I have to make a "simple" query on ORACLE 11g DB who will output ONLY numbers in field1 who exceeded a specific threshold.
In other words, assuming I have the following data in database.
Doesn't matter the output order, the important thing is that only occurrences >= 3 based on FIELD1.
Now, this works perfect on MySQL:
Code:
SELECT A.FIELD1, A.FIELD2 , A.FIELD3
FROM
table A
INNER JOIN
(
SELECT FIELD1, COUNT (1)
FROM table
GROUP BY FIELD1
HAVING COUNT (1) >= 3
) AS B
ON A.FIELD1 = B.FIELD1
But on ORACLE 11g I got:
Code:
) AS B
*
ERROR at line 10:
ORA-00905: missing keyword
I need to connect my Oracle 11g DB from shell script with 'sysdba' permissions. To do this I have to switch user from 'root' to 'oracle'.
I've tried the following with no success.
su - oracle -c "<< EOF1
sqlplus -s "/ as sysdba" << EOF2
whenever sqlerror exit sql.sqlcode;... (2 Replies)