Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

oracle union

select t.lot_number
from inv.mtl_onhand_quantities_detail t
left join mtl_system_items_b mi
on t.inventory_item_id = mi.inventory_item_id
where mi.segment1 like '101%' and mi.organization_id = 102
group by t.lot_number having count(*)=1 union
select t.lot_number||'x'
from inv.mtl_onhand_quantities_detail t
left join mtl_system_items_b mi
on t.inventory_item_id = mi.inventory_item_id
where mi.segment1 like '101%' and mi.organization_id = 102
group by t.lot_number having count(*)=2
union
select t.lot_number||'y'
from inv.mtl_onhand_quantities_detail t
left join mtl_system_items_b mi
on t.inventory_item_id = mi.inventory_item_id
where mi.segment1 like '101%' and mi.organization_id = 102
group by t.lot_number having count(*)=3
union
select t.lot_number||'z'
from inv.mtl_onhand_quantities_detail t
left join mtl_system_items_b mi
on t.inventory_item_id = mi.inventory_item_id
where mi.segment1 like '101%' and mi.organization_id = 102
group by t.lot_number having count(*)=3
union È¥µôÖØ¸´¼Ç¼ union all±£ÁôÖØ¸´¼Ç¼¡£


Ïà¹ØÎĵµ£º

oracle ±í¿Õ¼ä²Ù×÷

oracle±í¿Õ¼ä²Ù×÷Ïê½â
  1
  2
  3×÷Õߣº   À´Ô´£º    ¸üÐÂÈÕÆÚ£º2006-01-04 
  5
  6 
  7½¨Á¢±í¿Õ¼ä
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

oracle constraints(2)

oracle Ô¼ÊøµÄ״̬
  oracleÔÚ´´½¨Ô¼ÊøºóĬÈÏ״̬ÊÇenabled VALIDATED
SQL> create table T2
2 (
3 VID NUMBER,
4 VNAME VARCHAR2(10) not null,
5 VSEX VARCHAR2(10) not null
6 )
7 /

Table created

SQL> alter table t2 add constraints PK_T primary key (vid); ......

PostgreSQLаæÌá¸ßOracle¼æÈÝÐÔ ÓûÓë¼×¹ÇÎÄÊԱȸߣ¿

ÉÌÒµ¿ªÔ´Êý¾Ý¿â³§¼ÒEnterpriseDBÓë6ÔÂ17ÈÕ·¢²¼ÁË×îеÄPostgres Plus¸ß¼¶·þÎñÆ÷°æ£¬ÆäÄ¿±êÊÇÌá¸ßÓëOracleÊý¾Ý¿âµÄ¼æÈÝÐÔ£¬EnterpriseDBÊÇ¿ªÔ´Êý¾Ý¿âPostgreSQL£¨Ò²½Ð×öPostgres£©±³ºóµÄÖ÷ÒªÉÌÒµÖ§³Ö¹«Ë¾¡£
ÆäʵPostgres Plus¸ß¼¶·þÎñÆ÷°æ²¢·ÇÍêÈ«¿ªÔ´£¬ËüÊÇÔÚ¿ªÔ´µÄPostgreSQLÊý¾Ý¿â»ù´¡Ö®ÉÏÌí¼ÓÁËÐí¶à¸½¼ÓÌØÐÔ£¬ÒÔÌá¸ßºÍO ......

oracle¸´Ï°£¨¶þ£© Ö®À©Õ¹ ÉèÖÃÊý¾Ý¿âΪֻ¶Á

      ºÙºÙ£¬Õ⻹ÊÇÉÏÕÂ֪ʶÁË£¬Ö»Êǵ¥Ò»Ð´³öÀ´±È½ÏºÃÒ»µã£¬ÒòΪÉÏÃæµÄÊǽϻù´¡µÄ£¬²»ÔõÃ´Éæ¼°²Ù×÷£¬¶øÕâÀïÊÇͨ¹ý²Ù×÷³öÀ´µÄ£¬ºÇºÇ¡£
      Ê×ÏÈ£¬´ò¿ªÊý¾Ý¿â·þÎñ£¬È»ºóͨ¹ý¿ØÖÆÌ¨´ò¿ªsqlplus£º
È»ºó½«Êý¾Ý¿âÉèÖÃΪֻ¶Á£ºalter database read only£»µ«ÊÇÄØ£¬ÕâÑùÊDz»Ä ......

oracleÅж϶ÔÏóÊÇ·ñ´æÔÚ

declare    
    v_isexist number(3,0):=0;  
begin  
    select count(1) into v_isexist from sys.all_objects where owner = 'TEST' and object_type = 'TABLE' and object_name = 'TAB1';
    if  v_isexist>0 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ