Solved

Creating a Table Problem

Posted on 2007-04-04
2
191 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Correct an issue with a where clause with calculation 2 45
SQL Syntax 14 40
Select question from MySQL 1 20
T-SQL: Need Group By to use "fuzzy logic"?? 3 14
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

735 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