-
December 18th, 2006, 12:32 PM
#1
-
December 19th, 2006, 12:51 PM
#2
Try this:
delete from server_error_reasons
where
hostid
not in
select hostid from temp_sunward_audit;
-
December 19th, 2006, 03:09 PM
#3
Senior Member
Originally Posted by alakhiyar
Try this:
delete from server_error_reasons
where
hostid
not in
select hostid from temp_sunward_audit;
'hostid' and 'hostname' are making up a unique key, so I have to check agains both of them. If I'll do a 'select' statement agains te temp table twice, MySQL comes up with an error.
But you gave me an idea I'm going to try out
Don\'t post if you\'ve got nothing constructive to say. Flooding is annoying
-
December 19th, 2006, 03:12 PM
#4
Senior Member
Nope it didn't work
Don\'t post if you\'ve got nothing constructive to say. Flooding is annoying
-
December 19th, 2006, 05:10 PM
#5
Senior Member
Final query
delete from server_error_reasons
where
CONCAT(server_error_reasons.hostid, server_error_reasons.hostname) not in (select CONCAT(hostid, hostname) from temp_sunward_audit);
using concatonation meant that I only needed to call on to the temp table once
Don\'t post if you\'ve got nothing constructive to say. Flooding is annoying
-
December 20th, 2006, 06:52 AM
#6
delete
from server_error_reasons
where
server_error_reasons.hostid
not in
(select hostid from temp_sunward_audit)
AND
server_error_reasons.hostname
not in
(select hostname from temp_sunward_audit);
that should do it
-
December 20th, 2006, 09:20 AM
#7
Senior Member
Originally Posted by alakhiyar
delete
from server_error_reasons
where
server_error_reasons.hostid
not in
(select hostid from temp_sunward_audit)
AND
server_error_reasons.hostname
not in
(select hostname from temp_sunward_audit);
that should do it
No offence, but you realy didn't pay attention
You repeated the original query I wrote, id does not work in MySQL server.
Don\'t post if you\'ve got nothing constructive to say. Flooding is annoying
-
December 20th, 2006, 12:13 PM
#8
i was thinking of using concat, it would have been my next idea. But be carefull to make sure your data is white space and null terminator free when entered.
-
December 20th, 2006, 04:14 PM
#9
sql: '<>' not equal
'!=' is algol, you are using the wrong language
you don't need the 'all'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|