달력

102011  이전 다음

'2011/10/13'에 해당되는 글 2건

  1. 2011.10.13 Oracle 3개 Table 조인
  2. 2011.10.13 [MFC] ON_COMMAND_RANGE 매크로

Oracle 3개 Table 조인

삽질 2011. 10. 13. 14:18

// 3개의 Table 조인시 
// 2개는 등가
// 나머지 하나는 비등가 조인...

select 
aa.F_INDEX_A,
aa.F_NUM_A,
bb.F_INDEX_B,
bb.F_NUM_B,
bb.F_DATA_B,
cc.F_INDEX_C
from T_AA aa, T_BB bb, T_CC cc
where
(
bb.F_INDEX_ULTASS_TRACKING IN
(
SELECT  
max(b.F_INDEX_B)
from T_AA a, T_BB b
where
(
(b.F_TIME IS NULL)
AND
(a.F_INDEX_A = b.F_INDEX_A_B)
)
group by b.F_INDEX_A_B
)
AND
(
// aa,bb table에는 데이터가 반드시 있다..(등가 조인)
aa.F_INDEX_A = bb.F_INDEX_A_B
)
AND
(
// cc table에는 데이터가 없을 수도 있다...(비등가 조인)
aa.F_INDEX_A = cc.F_INDEX_A_C(+)
)
)
;
Posted by 촌돌애비
|

MFC에서 연속적으로 연결된 resource id들의 command에 대해서 

하나의 function으로 처리할 수 있는 macro.... 


 
ON_COMMAND_RANGE(id1, id2, memberFxn )
Parameters

id1

Command ID at the beginning of a contiguous range of command IDs.

id2

Command ID at the end of a contiguous range of command IDs.

memberFxn

The name of the message-handler function to which the commands are mapped.

Remarks

The range of IDs starts with id1 and ends with id2.

Use ON_COMMAND_RANGE to map a range of command IDs to one member function. Use ON_COMMAND to map a single command to a member function. Only one message-map entry can match a given command ID. That is, you can't map a command to more than one handler. For more information on mapping message ranges, see Handlers for Message-Map Ranges.

There is no automatic support for message map ranges, so you must place the macro yourself.

Example

// The code fragment below shows how to use ON_COMMAND_RANGE macro
  // to map a contiguous range of command IDs to a single message 
  
  // handler function (i.e. OnRangeCmds() in the sample below). In 
  
  // addition, it also shows how to use CheckMenuRadioItem() to check a 
  
  // selected menu item and makes it a radio item.
  
  BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
     ON_COMMAND_RANGE(ID_COMMAND_RANGECMD1, ID_COMMAND_RANGECMD3, &CChildFrame::OnRangeCmds)
  END_MESSAGE_MAP()
  
  void CChildFrame::OnRangeCmds(UINT nID)
  {
     CMenu* mmenu = AfxGetMainWnd()->GetMenu();
     CMenu* submenu = mmenu->GetSubMenu(5);
     submenu->CheckMenuRadioItem(ID_COMMAND_RANGECMD1, ID_COMMAND_RANGECMD3, 
        nID, MF_BYCOMMAND);
  }
  
Posted by 촌돌애비
|