tyson記事本

Google & man(Unix) are your best friends!

亂數取記錄

selecting random record.
select employees,name from
(select employees,name from usertable order by dbms_random.value)
where rownum < = 5
update: ref: http://forums.oracle.com/

Can one drop a column from a table?

Can one drop a column from a table?
Can one drop a column from a table?From Oracle8i one can DROP a column from a table. Look at this sample script, demonstrating the ALTER TABLE table_name DROP COLUMN column_name; command.
Other workarounds: 1. SQL> update t1 set column_to_drop = NULL;
SQL> rename t1 to t1_base;
SQL> create view t1 as [...]

取重複值

select * from global_dept group by dept_no,dept_name having count(dept_name)>1