Solved

Creating a Table Problem

Posted on 2007-04-04
2
185 Views
Last Modified: 2010-03-20
At the beginning of each month I need to create a new table for the previous months data.

The table has the same column headings as another table in the database.

I have been given the code below for the data part

SELECT distinct *
FROM table
Where etc

What is the SQL for creating the table and how do I use the code above to populate it?

Thanks
0
Comment
Question by:halifaxman
2 Comments
 
LVL 9

Accepted Solution

by:
TheSloath earned 250 total points
ID: 18849328
SELECT distinct * INTO tblNewTable
FROM table
Where etc
0
 
LVL 8

Expert Comment

by:mnrz
ID: 18849438
if you are using Oracle:

create table new_table as
SELECT distinct *
FROM table
Where etc
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
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 video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

11 Experts available now in Live!

Get 1:1 Help Now