考虑下表SQL连接表自行寻找差异
CREATE TABLE `temp` (
`id` int(11) NOT NULL,
`lang` char(2) COLLATE utf8_unicode_ci NOT NULL,
`channel` char(2) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`,`lang`,`channel`)
)
insert into `temp` (`id`, `lang`, `channel`, `name`) values('1','fr','ds','Jacket');
insert into `temp` (`id`, `lang`, `channel`, `name`) values('1','en','ds','Jacket');
insert into `temp` (`id`, `lang`, `channel`, `name`) values('2','en','ds','Jeans');
insert into `temp` (`id`, `lang`, `channel`, `name`) values('3','en','ds','Sweater');
insert into `temp` (`id`, `lang`, `channel`, `name`) values('1','de','ds','Jacket');
的问题是我怎么能找到与郎恩条目不为FR存在吗? 我的头卡住了,我相信这是一个微不足道的查询,但我有这些日子之一。
你如何配合他们?按ID还是按名称? –