clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2335853 fiddles created (27448 in the last week).

CREATE TABLE 廠商 ([PIN碼] int, [廠牌] nvarchar(5)); INSERT INTO 廠商 ([PIN碼], [廠牌]) VALUES (123, N'蘋果'),(456, N'花碩'),(789, N'三興'); select * from 廠商
PIN碼 廠牌
123 蘋果
456 花碩
789 三興
 hidden batch(es)


CREATE TABLE 編碼 ([PIN碼] int, [編碼] varchar(3)) ; INSERT INTO 編碼 ([PIN碼], [編碼]) VALUES (123, 'A01'),(123, 'A03'),(456, 'B11'),(456, 'B12'),(789, 'C77'), (789, 'C78'),(789, 'C79'),(789, 'C80'); select * from 編碼
PIN碼 編碼
123 A01
123 A03
456 B11
456 B12
789 C77
789 C78
789 C79
789 C80
 hidden batch(es)


select T1.PIN碼,T1.編碼,T2.廠牌 from 編碼 T1 left join 廠商 T2 on T1.PIN碼 = T2.PIN碼
PIN碼 編碼 廠牌
123 A01 蘋果
123 A03 蘋果
456 B11 花碩
456 B12 花碩
789 C77 三興
789 C78 三興
789 C79 三興
789 C80 三興
 hidden batch(es)