在SQL中创建具有多个值的列的表 [英] Creating Tables with Columns having mulitple values in SQL
本文介绍了在SQL中创建具有多个值的列的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我分配了一个任务,以便在像这样的表上运行一些SQL查询:
T1
C1 | C2 | C3
x1 | y1 | z1
x2 | y2 | z2
I've got an assignment to run some SQL queries on a table looking like this:
T1
C1| C2 | C3
x1| y1 | z1
x2| y2 | z2
但是我不确定如何在SQL中创建表。
But I'm not sure how to create the table in SQL.
推荐答案
您确定设计表的正确方法吗?
Are you sure is the right way to design the tables?
看起来像一个简单的主/明细模型
It look like a simple Master/Detail model
可能您的T1表是master
Probably your T1 table is the master
在第二个表(C)上将带有参考ID的列添加到主表
On the second table (C) put a column with reference ID to the main table
使用简单的Join或Left做查询加入
The do the query with a simple Join or Left Join
这篇关于在SQL中创建具有多个值的列的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文