凤凰新媒体 版权所有 不得转载 lawyer@ifeng.com
京ICP证030609号 本站通用网址:凤凰网
客服电话:(010)84458487 客服邮箱blog@ifeng.com
I have 2 tables. Say table1 has 100 rows.
Table1 has a field 'MFG' which is a 2 char code.
I want to replace the 2 char code with a lookup value from table2 which may or may not include all 2 char codes...
So I do:
SELECT TABLE2.MFG_CODE FROM table1 LEFT OUTER JOIN table2 ON table1.MFG=table2.MFG;
Because table2 does not contain all possible MFG codes in table1, the query is returning more than the number of rows originally in table1.
Question: Is there a simpler way to do a lookup of the value I need from table2 while returning all (but not more) rows from table1?
请登录以后再发表评论。