---
title: "DB2 SQL: How to Copy Data in one Table to Another Table"
description: "How to copy Table data to another Table in DB2."
url: https://srinimf.com/2015/03/31/db2-v11-copy-data-one-table-to-another/
date: 2015-03-31
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2015/03/pexels-photo-1201673.jpeg?fit=1880%2C1056&ssl=1
categories: ["DB2"]
tags: ["DB2 Copy Table", "DB2 Tips and Solutions"]
type: post
lang: en
---

# DB2 SQL: How to Copy Data in one Table to Another Table

The below are the steps we need to follow. First, we need t create a new table.

```
CREATE TABLE DA31.TELE
(NAME2 VARCHAR(15) NOT NULL,
NAME1 VARCHAR(12) NOT NULL,
PHONE CHAR(4))
```

Now new Table TELE is created. I want to copy  some old data into this new table.

```
INSERT INTO DA31.TELE
SELECT LASTNAME, FIRSTNME, PHONENO
FROM DA31.EMP 
WHERE WORKDEPT = 'D21';
```

Related[DB2 database – Here’s All About its Two Top Failures](https://srinimf.com/2015/09/22/how-system-failure-and-server-failure-handles-in-db2/)

Now Data is copied into new table.

The CREATE TABLE statement example creates a table which, at first, is empty. The table has columns for last names, first names, and phone numbers, but does not have any rows.

The INSERT statement fills the newly created table with data that is selected from the DA31.EMP table: the names and phone numbers of employees in department D21.

This way we can copy data from one table to another table. No need to use any Tool or load utility. This is simple sql query.

Related[DB2 SQL Global variables top usage](https://srinimf.com/2015/10/07/db2-global-variables-in-version-11/)

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2015%2F03%2F31%2Fdb2-v11-copy-data-one-table-to-another%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2015%2F03%2Fpexels-photo-1201673.jpeg%3Ffit%3D1200%252C674%26ssl%3D1&description=DB2%20SQL%3A%20How%20to%20Copy%20Data%20in%20one%20Table%20to%20Another%20Table)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2015/03/31/db2-v11-copy-data-one-table-to-another/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2015/03/31/db2-v11-copy-data-one-table-to-another/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2015/03/31/db2-v11-copy-data-one-table-to-another/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2015/03/31/db2-v11-copy-data-one-table-to-another/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20DB2%20SQL%3A%20How%20to%20Copy%20Data%20in%20one%20Table%20to%20Another%20Table&body=https%3A%2F%2Fsrinimf.com%2F2015%2F03%2F31%2Fdb2-v11-copy-data-one-table-to-another%2F&share=email)
-

### Like this:

Like Loading…
