Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-29-2006, 07:07 PM   #1 (permalink)
ashok rajagopal
Registered User
 
ashok rajagopal's Avatar
 
Join Date: Sep 2005
Posts: 20
ashok rajagopal is on a distinguished road
Oracle SQL

I have a table T1 with columns A,B,C,D. for each unique A-B-C combination, i have a number of values in D. I want to create a new table T2 with columns A,B,C,E where A,B,C make up a primary key ,and E is the sum of all D values corresponding to A,B,C .

How can i do it ?
ashok rajagopal is offline   Reply With Quote
Old 03-31-2006, 12:52 PM   #2 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 285
technobard is on a distinguished road
create table t2
as
select a, b, c, sum(d) e from t1
group by a, b, c;
__________________
It takes 2 points to draw a straight line, but at least 3 points to draw a conclusion.
technobard is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Oracle Offers Free Database technobard Code Newbie News 0 10-31-2005 06:48 AM
help with SQL and VB.NET doobiwan Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 4 06-10-2005 07:09 AM
New to SQL and databases rmill9681 Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 3 09-09-2004 08:31 AM
php & oracle.. viruz PHP 3 09-08-2004 11:07 AM


All times are GMT -8. The time now is 10:03 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting