iqx.iq_deal_contact.contact_type_id
iqx.iq_deal_contact.contact_id
iqx.iq_contac.contact_idiqx.iq_contact.contact_name
Display the Vice President Name (iqx.iq_contact.contact_name) associated with the portfolio (iqx.iq_deal_contact.deal_id) where the contact type is Vice President (iqx.iq_deal_contact.contact_type_id 这是逻辑过程,这个不需要细看
使用相同的iqx.iq_contact.contact_name字段,显示不同的结果,通过iqx.iq_deal_contact.contact_type_id=1,2,3 来控制

解决方案 »

  1.   

    看晕了,呵呵,你的Vice President , AVP, Portfolio Manager是不同的表吗?
    如果是,则
    select * from  ( 
      select 1, iqx.iq_contact_contact_name from [Portfolio Manager]
      union all
      select 2, iqx.iq_contact_contact_name from [AVP]
      union all
      ...
      )
      

  2.   

    显示AVP(iqx.iq_contact.contact_name),条件(iqx.iq_deal_contact.contact_type_id = 2)显示Vice President (iqx.iq_contact.contact_name) ,条件(iqx.iq_deal_contact.contact_type_id = 1)显示Portfolio Manager(iqx.iq_contact_contact_name) 条件(iqx.iq_deal_contact.contact_type_id = 2)具有相同的字段名,只有条件不同,如何一下子把三列内容显示出来?
      

  3.   

    Vice President  AVP    Profolio Manager
    XXX             YYY       ZZZ输出结果应是这样,Vice President , AVP, Portfolio Manager这是字段的名词.不是不同的表
      

  4.   

    Please help me,I don't knwo how to write that sentences.