473,385 Members | 1,630 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,385 software developers and data experts.

A really DUMB question...

I have 4 tables (AA,MAIN,CC,DD)
Everything that is not in AA but is in MAIN I want put into CC
Everything that is not in MAIN but is in AA I want put into DD
Add everything in DD to MAIN
Clear AA CC and DD

Thanks in advance
Jul 20 '05 #1
3 1433
When you say put, do you mean copy or move?
Jul 20 '05 #2
What is the purpose of CC, it doesn't seem to determine anything and then it
gets cleared?

INSERT cc
SELECT main.*
FROM main
WHERE main.rowid NOT IN (SELECT rowid from aa)

INSERT dd
SELECT aa.*
FROM aa
WHERE aa.rowid NOT IN (SELECT rowid from main)

INSERT main
SELECT * from dd

DELETE aa
DELETE cc
DELETE dd

--
*************************************
Andy S.
an********@yahoo.com

*************************************
"Chris Petersen" <pe*********@hotmail.com> wrote in message
news:d1**************************@posting.google.c om...
I have 4 tables (AA,MAIN,CC,DD)
Everything that is not in AA but is in MAIN I want put into CC
Everything that is not in MAIN but is in AA I want put into DD
Add everything in DD to MAIN
Clear AA CC and DD

Thanks in advance

Jul 20 '05 #3
I have 4 tables (AA,MAIN,CC,DD)
Everything that is not in AA but is in MAIN I want put into CC
Everything that is not in MAIN but is in AA I want put into DD
Add everything in DD to MAIN
Clear AA CC and DD
insert into CC select * from MAIN
delete C from CC c join AA a on a.ID = c.ID

insert into DD select * from AA
delete d from DD d join MAIN a on a.ID = d.ID

truncate table AA (etc)
Jul 20 '05 #4

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

Similar topics

16
by: squash | last post by:
a dumb question i had on my mind: Say you have a dynamically created web page . Isn't it more secure to write it in php since a visitor will not be able to tell it is dynamically created? But...
15
by: Good Man | last post by:
Hey there I have a dumb question.... Let's say i have a database full of 4000 people.... I select everything from the database by: $result = mysql_query("SELECT * FROM People");
3
by: MostlyH2O | last post by:
Hi Folks, I'm sorry if this is the wrong place to ask a really newbie question, but I can't seem to get an answer to what seems to be a simple question... What is the difference, with regard...
0
by: Duncan Mole | last post by:
Hi, I know this is dumb but if I add a reference to the release version of a company class library in debug and build it it works fine. If I then switch to release and rebuild the reference is...
3
by: ed | last post by:
I've just started working with .Net, so appologize for what is probably a really dumb question. Did Windows XP originally come with the .Net framework installed, and if so which version? ...
2
by: InvisibleMan | last post by:
Hi, I feel a little dumb for asking this (considering im writing TSQL) but there doesn't seem to be any definitive answers on the search engines... Okay I understand that if you open the ADO...
2
by: Bill Nguyen | last post by:
I would like to add a new VB.NET project using the same folder being used by another project so that I can share several forms already creaded by the other project. However, .NET created a new...
16
by: CMM | last post by:
Is it me or has anyone noticed that F1 is really dumb in VS2005. Since VB3 I have been able to click F1 on an ambiguous method in code and the IDE automatically determines the type based on the...
14
by: dba_222 | last post by:
Dear experts, Again, sorry to bother you again with such a seemingly dumb question, but I'm having some really mysterious results here. ie. Create procedure the_test As
6
by: Robert Dufour | last post by:
What is the meaning of the word marshal and unmarshal in plain english as applied to an exe file? Does it mean the application has started and ended? Thanks for any help, Happy new year, Bob
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.