我想在数据库中查询没有关系(即外键)的节点。我尝试了这个加入声明,但它没有用
SELECT nodes.*, relationships.* FROM nodes inner JOIN relationships ON nodes.id = null;
如何只显示没有关系的节点?谢谢你
nodes Relationships
----- -------------
id int(11), id int(11),
name varchar(35), to int(11), //this is the destination node from the id relation
color varchar(7), data varchar(0) null
type varchar (12), Foreign key (id) references nodes(id)
Primary key (id)
engine = innodb