我打破了我在这个简单的法典和平上的头脑,而这种和平却不希望工作,我只能想到任何其他解决办法。
请帮助它开展工作吗?
SELECT chart FROM chart WHERE (select count(user_id) FROM users join charts ON
user_id=charts.UID and charts.chart=chart WHERE INET_NTOA(user_ip)= 127.0.0.1 )=0;
以下各栏有3个表格:
chart(
chart int(5)
);
charts(
UID int(11),
chart int(5)
);
`users` (
`user_id` int(11),
`user_ip` int(10)
);
要点是,应从首选的图表栏改为图表。 图=图表,但次位数最终与本身比较,即海图=chart,总是真实。
我知道它赢得了这样的工作,但我确实想不到任何其他方式。 难道对我想要做的事情没有任何办法?
EDIT 1: Basically I need a reverse selection:
select chart.chart from chart join charts on chart.chart=charts.chart join users
on user_id=charts.UID and INET_NTOA(user_ip)= 127.0.0.1 ;
This query returns charts that are tagged by user with given ip, eg: 1, 4,5, 9. But I need to select the ones that are not tagged instead, that is: 2,3,6,7,8,10 and so on...
EDIT 2: I m looking for some sort of negative join now. I think this would do, but I m clueless how to use it. Meanwhile making some research...