Monster Oasis
覺得累就是進步的開始!

2009/04/23

SQL 的 union 的作法

Filed under: DATABASE,JOB — Tags: , , — 9:06 pm

The UNION query allows you to combine the result sets of 2 or more “select” queries. It removes duplicate rows between the various “select” statements.

select count(1) from (
      — 賣家
      select ctrl_rowid
      from bidleader.sold_record s
      where s.ctrl_date like ’200701%’
      group by ctrl_rowid
      union
      — 買家
      select p_ctrl_rowid  ctrl_rowid
      from bidleader.sold_record s
      where s.ctrl_date like ’200701%’
      group by p_ctrl_rowid
) t

Related URL:
  1. install oracle 11g steps
  2. 一些 memcache 的資料
  3. Protected: Oracle down time / problem records / 經典
  4. Database administrator
  5. 在 gentoo 裝 oracle sqlplus package
  6. Graphical Database Schema Metadata Browser – SchemaSpy
  7. wordpress 的 schema
  8. Oracle documentation library
  9. MySQL – Optimizing Database Structure
  10. Protected: 規格表 schema

Enter your password to view comments.


www.monster.com.tw , © Copyright 2008