由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Mathematics版 - SQL combine two tables into one table and add a new column (转载)
相关主题
SQL check likeness between two large tables (转载)计算器游戏
弱问一道数学题An intersting mathematic problem for selecting wife(or husb
a question about matrixhow to proof
求:toeplitz matrix inversion Gohberg Semetsul formula何为inverse table?
问个问题latex的一个简单问题
latex中$$ $$和\[ \]有什么区别?求solver
data grouping, sub-grouping by column variable in R (转载)帮看道基础概率题 有包子 (转载)
求助,关于数学问题(来自美国数学大联盟题目)投稿问题请教
相关话题的讨论汇总
话题: sql话题: column话题: select话题: group话题: add
进入Mathematics版参与讨论
1 (共1页)
l******9
发帖数: 579
1
【 以下文字转载自 Database 讨论区 】
发信人: light009 (light009), 信区: Database
标 题: SQL combine two tables into one table and add a new column
发信站: BBS 未名空间站 (Thu May 8 14:54:50 2014, 美东)
I need to add a column with an int value to the result from a subquery on
SQL.
It is Netezza SQL.
SELECT *
FROM
(
SELECT *
FROM table1
JOIN
table2
ON table1.id1 = table2.id1
GROUP BY table1.id2, table2.id3
) AS tt_a # here, I need to add a new column to tt, call it as top_id
and also assign an int value to it, such as 80
FROM
(
SELECT *
FROM table1
JOIN
table3
ON table1.id1 = table3.id1
GROUP BY table3.id2, table3.id3
) AS tt_b # here, I need to add a new column to tt, call it as top_id
and also assign an int value to it, such as 81
GROUP BY top_id, id2, id3
I em new to SQL.
Any help would be appreciated.
h**********c
发帖数: 4120
2
study study relational algrebra
first chapters in major texts
go SQL first is not considered a good approach.
Put your enligsh/chinese requirement text below. I try to do some thing
after read it.
1 (共1页)
进入Mathematics版参与讨论
相关主题
投稿问题请教问个问题
请教大牛们一个概率问题latex中$$ $$和\[ \]有什么区别?
帮朋友发帖找人,版主请留情勿删data grouping, sub-grouping by column variable in R (转载)
四小数学家求助,关于数学问题(来自美国数学大联盟题目)
SQL check likeness between two large tables (转载)计算器游戏
弱问一道数学题An intersting mathematic problem for selecting wife(or husb
a question about matrixhow to proof
求:toeplitz matrix inversion Gohberg Semetsul formula何为inverse table?
相关话题的讨论汇总
话题: sql话题: column话题: select话题: group话题: add