473,480 Members | 5,041 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how do i select all the other entries other than specified in the list using IN

1 New Member
I have to delete all entries other than specified using a IN statement. If my Mysql query is

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM `service' where id in (122,123,124,125);
  2.  
I want to select all the other entries with ids other than 122,123,124 and 125 and delete them.

Thanks in advance.
Jun 24 '10 #1
1 1253
JKing
1,206 Recognized Expert Top Contributor
@sandeepand
Hi there,
You can use the NOT keyword before your IN.

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM `service' 
  2. WHERE id NOT IN (122,123,124,125);
  3.  
Jun 24 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2345
by: Krista | last post by:
Hi, Do you have any idea when I try to select a drop box list, the data will show up in the following textbox immediately? eg. Name: --------------- drop-box list | <- when i...
9
1929
by: Rogue9 | last post by:
Hi, I´m trying to retrieve an item from a list using a reference called ´draw´' (which is an integer from 1 to 792 in a while loop) using:- draw = 1 while 1: if draw == 792: break b1 =...
9
2300
by: Paul | last post by:
Can anyone suggest an efficient way to eliminate duplicate entries in a list? The naive approach below works fine, but is very slow with lists containing tens of thousands of entries: def...
1
9976
by: Rod Early | last post by:
I need to know when the select element's dropdown list is opened (as when the user clicks on the arrow or does ALT-downarrow from the keyboard). Similarly, I need to known when the dropdown list...
4
2798
by: Andy Weinmann | last post by:
I need to make a form through which I can edit the information for companies. I used a form in which the textboxes read from different columns from a listbox to display the information for a...
2
1559
by: Andy Warner | last post by:
Hello all, I have a listbox with 2 'fields' and a choice of 100 or so items that can be selected. User can select multiple items (i'm using the simple multiitem model) as normal. however,...
13
1896
by: Mel | last post by:
i would like set my <Selectoptions from a list AFTER the form is created and a list of urls for those selections from javascript. How can i do this My select may have a list like: "Go to One",...
10
14994
by: Debajit Adhikary | last post by:
I have two lists: a = b = What I'd like to do is append all of the elements of b at the end of a, so that a looks like: a =
6
12652
by: Craggy | last post by:
Is it possible to adjust the multi select property of a list box using VBA? my initial thaught would be Me.List43.multi select = simple but this produces an error.
0
7041
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6908
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
2994
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.