我有<svg height="300px" width="300px" viewBox="0 0 12 16">
<path fill="#FFF" stroke="black" stroke-width="0.5" stroke-linejoin="miter"
d="M 6 1 c -2 3 -5 5 -5 9
0 7 10 7 10 0
0 -4 -3 -6 -5 -9z" />
</svg>
的一个表和<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<style> v\:* { behavior: url(#default#VML); }
</style >
</head>
<body>
<div style="width:240; height:320;">
<v:shape coordorigin="0 0" coordsize="12 16" fillcolor="white" strokecolor="black" strokewidth="1"
strokeweight="5" style="width:240; height:320"
path="M 6 1 v -2 3 -5 5 -5 9
0 7 10 7 10 0
0 -4 -3 -6 -5 -9 x e">
</v:shape>
</div>
</body>
</html>
的另一个表。我想contributions
没有相关的贡献。
我可以加入profiles
上的两个表格。
非常感谢任何帮助!
答案 0 :(得分:2)
使用NOT EXISTS
查找没有关联贡献的配置文件:
select * from profiles p
where NOT EXISTS (select 1 from contributions c
where c.profiles_id = p.id);
答案 1 :(得分:1)
Try this.
select p.* from profiles p
left join contributions c on p.profile_id=c.profie_id
where c.profile_id is NULL ;
答案 2 :(得分:0)
*查询您需要的是:
SELECT
colA,
colB,
....
FROM contributions tb1
WHERE
NOT EXISTS ( SELECT * from profiles tb2 where tb1.profiles_id = tb2.id )
GROUP BY
colA,
colB,
....