473,378 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Removing records from one tables that common in other table.

Must be very simple but don't know how to delete records.

I have two tables A, and B. Table A has total 7926 records. 3126
records out of these 7926 is in table B. I need to remove these 3126
records from Table A.

Thanks.
Nov 12 '05 #1
2 3098
Habibullah wrote:
Must be very simple but don't know how to delete records.

I have two tables A, and B. Table A has total 7926 records. 3126
records out of these 7926 is in table B. I need to remove these 3126
records from Table A.

Thanks.

DELETE
FROM
[Table A] As a
WHERE
EXISTS (SELECT * FROM [Table B] WHERE ID = a.ID)

--
'-------------------------------
' John Mishefske
'-------------------------------

Nov 12 '05 #2
mi*****@uci.edu (Habibullah) wrote in message news:<7e**************************@posting.google. com>...
Must be very simple but don't know how to delete records.

I have two tables A, and B. Table A has total 7926 records. 3126
records out of these 7926 is in table B. I need to remove these 3126
records from Table A.

Thanks.


Remove all records from table A that are in table B....

DELETE TableA.SomeNumber
FROM TableA INNER JOIN TableB ON TableA.SomeNumber = TableB.SomeNumber;
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
1
by: | last post by:
I have 2 tables from which I am pulling data for my query. If I pull ID from Table 1 and then pull corresponding measures from table 2, I get several repeats of my records for each row. So, if...
1
by: Steve Claflin | last post by:
I have a database with a moderate number of records in several tables (the biggest table at the moment is about 800 records). In development it got moved between 2K and XP repeatedly. Several...
1
by: phaddock4 | last post by:
Being fairly inexperienced at Access 2000, i've been reading many posts here for the last several days, and testing myself to find the best approach to do the following in A2K: SET UP: I have...
1
by: Coy Howe | last post by:
This one seems bizarre! We have a database consisting of a main table and 12 - 15 "sub" tables, which are connected via cascading relationships. The database performs many complex calculations...
3
by: MLH | last post by:
I have two tables with a common field containing an automobile VIN code. If I create a query putting both tables in the QBE grid and link the common field between the two tables and drop one...
2
by: Steve Cartnal | last post by:
I need to copy records from several different tables into one text file. Although the tables have many common fields, they also contain several that are different from table to table. I can copy...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
4
by: Jeffrey Davis | last post by:
I'm hoping that someone here can give me some assistance with a database I'm trying to set up. My skills in Access are fairly basic, and I'm trying to skill up, but some of the stuff is a little...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.