Hot answers tagged

3

The columns ABSENT, LATE and PRESENT in your output represent totals per student, whereas the date columns represent details per student, and details are the pivoted columns. In order to get such output with PIVOT, your source must provide totals on the same row with details. The source in your query is not providing that kind of information. It is grouping ...


2

Lets see what the Oracle supplied oerr utility says about you errors. [oracle@testsrv Desktop]$ oerr ora 19804 ORA-19804 cannot reclaim %s bytes disk space from %s limit Cause: Oracle cannot reclaim disk space of specified bytes from the DB_RECOVERY_FILE_DEST_SIZE limit. Action: There are five possible solutions: 1) Take ...


2

First get rowid of the row and object id of the object using DBMS_ROWID. SQL> insert into t3 values('S00102981655537O',sysdate,'IN-RJ'); 1 row created. SQL> select dbms_rowid.rowid_object(rowid) from t3 where doc_id='S00102981655537O'; DBMS_ROWID.ROWID_OBJECT(ROWID) ------------------------------ 93178 SQL> select subobject_name ...


2

you can not do in dynamically like this. partition name has to be known and the time when statement is compiled. But you can use PARTITION FOR clause: UPDATE TABLE T PARTITION FOR(TO_DATE('31-JAN-2007','dd-MON-yyyy') ...


1

COUNT counts values that are not NULL. You can transform the unneeded values into NULL for example with DECODE. Combining the two as below: select student_id, count(decode(attendance_id, 'ABSENT', 1, null)) as absent_count, count(decode(attendance_id, 'PRESENT', 1, null)) as present_count, from attendance group by student_id ; Or you ...


1

This is definitely possible both with VMware and VirtualBox and any other mainstream virtualization product as well I guess. On my VMware vSphere sandbox, I have created an additional virtual switch that is not mapped to any physical network adapters. This network is not visible/reachable from the outside world, but VMs attached to it can reach each other ...


1

The first query you have used returns Cartesian product of the rows from these three tables. For details: Join The following is the simple example to join three tables. SQL> select * from student; STUDENT_ID FIRSTNAME LASTNAME ---------- -------------------- -------------------- 1 Will Smith SQL> select * from module; ...


1

You can achieve the same goal by having a UNIQUE composite index on the desired fields. ALTER TABLE YourTable add CONSTRAINT YourTable_unique UNIQUE (A, B,....); (A, B, ...) should be NOT NULL. This might be helpful if you have a surrogate PRIMARY KEY which you may want to keep. This was recently asked for MySQL here, but the principle is the same. ...


1

The standard approach to get rows N through M is to do something like SELECT * FROM (SELECT a.*, rownum rnum FROM (SELECT emp_id, last_name FROM employees WHERE positionID in (1,3) ORDER BY <<something>>) a WHERE rownum <= 60) b WHERE rnum > 50 Note that you need ...


1

After renaming the table, rename the constraint and the index as well: alter table cba rename constraint abc to cba; alter index abc rename to cba;


1

Whenever you create a table with constraints in Oracle, an entry is made into the user_constraints table and if constraints involve creation of an index (like in this case, primary key constraint also creates a clustered index), an index is also created on the table which you can find querying user_indexes. select * from user_constraints where ...



Only top voted, non community-wiki answers of a minimum length are eligible