id name type company 1 СÃ÷ type_a ¹«Ë¾1 2 СÍõ type_b ¹«Ë¾1
TableB id type_a type_b type_c company 1 11 43 88 ¹«Ë¾1 2 33 55 78 ¹«Ë¾2
ÏëµÃµ½µÄ½á¹û
id name type company 1 СÃ÷ 11 ¹«Ë¾1 2 СÍõ 43 ¹«Ë¾1SQL code: select a.id,a.name,b.type,b.company from tablea a,tableb where a.id=b.id
SQL code: select a.id,a.name,b.type_a as type,a.company from table1 a join table2 on a.company=b.company union all select a.id,a.name,b.type_b as type,a.company from table1 a join table2 on a.company=b.company
1Â¥µÄ¼ò½à£¬ºÃ 1Â¥µÄ¼ò½à£¬ºÃ SQL code:
select id, name, case a.when 'type_a' then b.type_a when 'type_b' then b.type_b else type_c end, company from tablea a,tableb b where a.id=b.id
select count(1) from FX_RETURNBOOKCHECKLIST fxreturnbo0_ where fxreturnbo0_.BOOKID='164 ' AND fxreturnbo0_.RETURNID='00025.S0000001' ÉÏÃæÒ»¸ö¼òµ¥µÄSQL,Ö´ÐÐʱ¼ä2.6à ......