Solved

Copy data from one table to another

Posted on 2008-06-11
2
189 Views
Last Modified: 2010-04-21
I have two tables, i need to copy data from one to another, below are the table names and field names, they are in the order in which they should be copied, like cases.id should be copied to activities.caseid, etc ...

table 1: cases

id, firmid, inscasenum, aosfiledat, i140filingdate, approvaldate, expdate, 1

table 2:  activities

caseid, firmid, actdesc, dateinitiated,lastmodified,schdemailon, complete

ONLY where cases.InsCaseNum is not null

How can I do this ?
0
Comment
Question by:amucinobluedot
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 21760601
simple insert:
INSERT INTO activities ( caseid, firmid, actdesc, dateinitiated,lastmodified,schdemailon, complete )
 SELECT id, firmid, inscasenum, aosfiledat, i140filingdate, approvaldate, expdate, 1
   FROM cases
  WHERE cases.InsCaseNum is not null

Open in new window

0
 

Author Closing Comment

by:amucinobluedot
ID: 31466177
thx
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Select2 jquery help 9 74
return result by latest date - oracle query 21 69
SQL Query Syntax Error 9 48
SQL Server R2 Stored procedure performance 8 42
If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now