PL/SQL :: Get Asset_type For Which Count Is Maximum?
Jun 20, 2013
select SEARCH_ID, SEARCH_KEYWORD, COUNT, ASSET_TYPE from RELEVANCY_TABLEwhere SEARCH_KEYWORD = 'search_keyword'and ASSET_TYPE is not null 558search_keyword3desk559search_keyword7table
I actually need to get the asset_type for which count is the maximum. In this case it should be 'table'.
View 4 Replies
ADVERTISEMENT
May 21, 2010
how do I count a list of number value eg 1,1,1,1,3,3,6,4 and find the one with maximum number which is 1
View 5 Replies
View Related
Mar 7, 2013
I'm currently doing migration from Oracle 10gR2 RDF to Oracle 11gR2 Semantic Technology.I followed the steps on the documentation and successfully created the network using the following:
-----
EXECUTE SEM_APIS.CREATE_SEM_NETWORK('rdf_tblspace');
CREATE TABLE rdf_network_trace (id NUMBER, triple SDO_RDF_TRIPLE_S);
--Created SEQUENCE andTRIGGER FOR rdf_network_trace id
[code]....
when I looked at my Node Ids, they were like +635762253807433724+, +6118969225776891730+. The problem is, I am not the one who is assigning Node Ids, They were automatically generated when inserting TRIPLE data to the rdf table.
Did I miss something when I created my network?
View 11 Replies
View Related
Nov 16, 2009
When we execute select count(*) from table_name it returns the number of rows.
What does count(1) do? What does 1 signifies over here? Is this same as count(*) as it gives the same result on execution?
View 13 Replies
View Related
Nov 24, 2011
difference between count(1) and count(*). As i know count(*) will give number of rows irrespective of null and count(1) will not count the null.My Oracle version is 10 g.
SQL> select * from t1;
A B C
---------- -------------------- --------------------
1 2 3
2
5
SQL> select rownum,a.* from t1 a;
ROWNUM A B C
---------- ---------- -------------------- --------------------
1 1 2 3
2 2
3 5
4
[code]....
View 3 Replies
View Related
Mar 28, 2012
I need to find the maxmimum value in a row, which consists 4 fields.
Columns: field_1, field_2, field_3, field_4
values : 2 , 4, 5, 1
the output should be field_3 =5
View 2 Replies
View Related
May 11, 2011
I'm having some issues with my NVarchar2 columns that I want to solve
My current NLS_CHARACTERSET is 'AL16UTF16', and therefore I can only create NVarchar2 columns with an maximum extension of 2000 bytes. But I do need a column with 4000 bytes length. How can I create an 4000 NVarchar2 column?
(I do not want to use a CLOB column...only a NVarchar2)
View 5 Replies
View Related
Jun 10, 2013
I want to create a table with a length greater than 30.I Thought there was a way to override the max length for for a table name in Oracle 11.2.0.2.I cant find a documentation that states how to get it done.
View 1 Replies
View Related
Aug 14, 2010
I want to display the maximum sum of salary among sum of salary of each department.
deptno sal
10 1000
10 500
10 100
20 2000
20 200
30 500
30 1500
30 2000
30 200
Sum of salary for each department.
10 1600
20 2200
30 4200
The output should be
30 4200
Because this the highest sum of salary compare to sum of salary of reaming departments.
View 4 Replies
View Related
Jan 3, 2013
We are having a production database configured in oracle 10.2.0.4 ( standard edition) and its contains near to 50000 tables . The database is accumulated by more than 100 tables everyday, and my question is is there is any table limits in oracle database ? especially in standard edition ??
View 8 Replies
View Related
Jan 31, 2013
I think the maximum length of table and column name in oracle 11g is 30 characters.I want to increase the limit as i want to import a mysql database that is having bigger table names.Can i preset the table name and column name length??
View 2 Replies
View Related
Aug 10, 2012
In my table three column are there, structure_code, attribute_code and percentage. one project have many attribute_codes, each attribute code have percentage value. The total of percentage value for a project is 100.
data like follows
structure_code Attribute_code percentage
160025 2531 30
160025 2536 20
160025 2537 50
160025 2538
162061 1468 0
Now i need to select which attribute_Code have maximum percentage for each project(structure_code).
View 3 Replies
View Related
Oct 2, 2012
how to check the maximum space ever used for TEMP. I want to know it because I need to resize the TEMP and I want to know how small it can be. As I can see from a documentation hURL....max_size is max number of extens ever used in a segment
I could multiply max_size by extent_size and it would give me the max size of temp ever used
SQL> select segment_file, extent_size, max_size from v$sort_segment;
SEGMENT_FILE EXTENT_SIZE MAX_SIZE
0 128 23625
0 128 753
View 7 Replies
View Related
Jan 15, 2013
In my sql query, how can i fetch the row with max row count? the query has around 10 columns.
View 2 Replies
View Related
Oct 25, 2010
Test data for the problem is as follows.
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> with t
2 as
3 (
4 select 1 id, 12 compid, 1 rel_type, null enddt from dual union all
5 select 1, 13, 1, to_date('31.12.1993','dd.mm.yyyy') from dual union all
6 select 1, 14, 1, to_date('12.06.1996','dd.mm.yyyy') from dual union all
7 select 1, 15, 1, to_date('23.04.2003','dd.mm.yyyy') from dual union all
[code].......
I want to find the the latest compid for individual types 1 and 2 only within a list of ids. Latest compid is defined as the compid associated with the latest end date (null is treated as the latest end date).
So in the above example for rel_type = 1, compid : 12 is latest, for rel_type : 2, compid : 6 is latest.
Datatype for the tables are :
Id : Number
compid : Number
Rel_Type : Number
enddt : Date
View 4 Replies
View Related
Apr 8, 2011
What is the Maximum Charter length can be given as a column name in a table?
View 3 Replies
View Related
Sep 17, 2011
how can i find nth maximum or minimum salary from a employee table? here i want only one row as output.
View 16 Replies
View Related
Mar 10, 2010
How many maximum number of bind variables,can we use in Execute Immediate.
View 2 Replies
View Related
Jul 31, 2012
I've the following data set
with t as
(
select 1 cor_id , 'SR' rt_cd,TO_Date( '05/12/2010 01:12:19 PM', 'MM/DD/YYYY HH:MI:SS AM') dt,100 iss_id from dual union all
select 2 cor_id , 'SL' rt_cd,TO_Date( '05/12/2010 01:12:18 PM', 'MM/DD/YYYY HH:MI:SS AM') dt,100 iss_id from dual union all
select 3 cor_id , 'SR' rt_cd,TO_Date( '04/10/2010 02:11:15 PM', 'MM/DD/YYYY HH:MI:SS AM') dt,100 iss_id from dual union all
select 4 cor_id , 'SL' rt_cd,TO_Date( '04/10/2010 01:12:18 PM', 'MM/DD/YYYY HH:MI:SS AM') dt,100 iss_id from dual
)
select t1.*
from t t1for each iss_id =100 ,
there could me more than one record in the above data set, The requirement is i need to get the records where the trunc(dt) is maximum
I need to get 2 records with cor_id= 1 and 2.
how can i get those records
View 3 Replies
View Related
Mar 9, 2010
What is the maximum number of failures a job can allow,when we are scheduling jobs using DBMS_JOB.
View 1 Replies
View Related
Aug 9, 2010
any inbuilt function available for finding out the maximum value of a column out of a plsql collection.
View 15 Replies
View Related
Dec 16, 2011
I have to write function that receives department name and an aggregation operation (average, maximum, minimum) and apply the operation on the salary of employees working on the given department and return the result.
here is my select statement:
select distinct d.deptno, d.deptname, max(e.salary)
from employee e join department d
on e.deptno=d.deptno
where d.deptname=upper('finance')
group by d.deptno, d.deptname;
[code]...
View 9 Replies
View Related
Jun 23, 2013
i have a procedure which outputs 10 refcursors. It is called called by a .NET utility which then writes the data to 18 different flat files. The proc is of below format
CREATE OR REPLACE PROCEDURE FILE_EXTRACT
(OUTREC1 OUT SYS_REFCURSOR,
OUTREC2 OUT SYS_REFCURSOR,)
AS
BEGIN
OPEN OUTREC1 FOR
SELECT /*+PARALLEL(A,8)*/
COL1,COL2
FROM TABLE A;
[code]....
I have used parallel hint because all the tables used in the queries a huge tables and this is a nightly batch job. The issue here is that i have expected oracle to use 8 processes for this execution so all my select statements have parallel hint with degree 8 , but unusaully the procedure is erroring out on production databases because of maximum number of connections are being spawned and the database is not able to create any new session. When i debuged and did a quick test proc where i used only one out refcursor it ran only 9 threads . then i ran by adding one more out ref cursor it spawn 17 threads. I think its the way .NET is fetching data from each of these cursors.When i print the first refcursor i do see queries which are running for the second along with the first causing the parallel queries run more than expected. The cause of the problem here is all the refcursors are executed and waiting to return data. SO when .net starts reading first cursor the other queries also run.
View 0 Replies
View Related
Aug 23, 2012
select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for IBM/AIX RISC System/6000: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - ProductionI got below error on the datases.
ORA-00020: maximum number of processesBased on the suggestion got from previous posts, I did kill some (LOCAL=NO) processes to get myself in. When I looked at the number of processes the number is 150, I changed it to 1000. After a day I got the same error.
ORA-00020: maximum number of processes (1000) exceededI killed processes again to let my self in, bases on the post below, I queried database
ORA-00020: maximum number of processes (%s) exceededHere is the query to find out if there are any processes with out session attached to it.
select spid from v$process where addr not in (select paddr from v$session);Result
SPID
null
35259840
36897866
13369762
[Code]...
To determine the from where greatest number of processes originated
SELECT MACHINE, COUNT(*) FROM V$SESSION GROUP BY MACHINE;Machine Count(*)
2
CAPITAL-D3F0092 1
DQAKDCDKLCSW01 14
desmond 20
DQAKDCDKLCSA01 52
My question is why I am keep getting this? Why do increasing process from 150 to 1000 did not resolve the issue?
What can I do to make sure that I don't get this error again?
View 1 Replies
View Related
Sep 16, 2011
i got this error..
ORA-00020: maximum number of processes (1100) exceeded
my oracle version is 10.2.0.2.0
when i was trying to login to oracle i got :ERROR at line 1: ORA-01012: not logged on
lucky i was having another sqlplus login ..
wht i should do to bring the number of process down without increasing the process value and shuting/restaring down db.
"Usually, when this happens, I want to get connected to the instance, so that I can try to figure out which user is causing the problem. One way to do that is to use the 'ps' command to identify some of the oldest server processes, and kill the 3-5 oldest processes, and then quickly try connecting to the database. Once you're in, you can look at things like V$SESSION to try and determine which user(s) is (are) consuming so many connections, and then go from there."
this is what i got from [URL]....
1.if i am giving ps -ef in OS it will give lot of detail ...
2. in v$session wht i should look for ....
View 4 Replies
View Related
Oct 23, 2006
I think this is the scariest error I've encountered in oracle. After some thime of developing/debuggin I've always reached this error. This leaves me no choice but to restart the java app server, in that case I'll be affecting all the other applications deployed on it which is a very bad thing for me.
Is there anyway I could solve this, I've made it sure that I've handled all errors so that I could always close the connection. Simply put, for every termination case of my program I've placed a closing statement just to be sure that no connections are left open. But even after this, I still experience the ORA 0100 error.
View 8 Replies
View Related
Oct 21, 2011
I need to get the maximum value of the VALUE field of each record with different POINTNUMBER, then do an update on the 2nd table.
table 1
UTCTime TIMESTAMP (6)
INTEGER POINTNUMBER
FLOAT VALUE (126)
INTEGER TLQ
table 2 (idem structure)
UTCTime TIMESTAMP (6)
INTEGER POINTNUMBER
FLOAT VALUE (126)
INTEGER TLQ
Where POINTNUMBER is six thousand different values My query only returns me the maximum of a single record:
SELECT * FROM table1 WHERE value = (SELECT MAX (value) FROM table2);
And the update:
UPDATE table2 SET to a.value = (SELECT MAX (b.value) FROM table2 b);
so does on a single record.That needed to maximize each pointnumber different? I can use a cursor to do this easier?
Insertion should first make a one-time, and then updates every 1 hour
View 1 Replies
View Related
Jun 9, 2013
I don't know if there is a beginner forum out there for PL SQL, but I cannot find one.I just started taking an Intermediate Oracle course to learn PL SQL. Today is my first day and I just installed Oracle 11g. I was in SQL Plus, tried the edit command. I got the message "wrote file Afiedt.buf" and then it was just a flashing cursor in the line below. I could not type any commands. I just hit the X to close the program.
What could I have done to exit the program with that flashing cursor since I was unable to type anything?
View 7 Replies
View Related
Aug 19, 2010
Does Oracle automatically lock an account if the number of user login attempts exceeds the maximum?
View 3 Replies
View Related
Oct 9, 2013
I am getting error ORA-01450: maximum key length (3118) exceeded, when I going to create a Database(by dbca) with Block Size 4096 bytes.
Oracle Database:11.2.0.0
Platform: Windows server R2 64 bit
View 1 Replies
View Related