boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问个sql问题
相关主题
SQL combine two columns from two different tables no shared columns
问个sql 题
请教个SQL的问题
matrix question
大雪天裸体跪问关于young tableau的几道题目~~~
sql的2个问题
求教一个SQL的问题
count unique values in file with 1 million rows (转载)
如何用R处理大文件 (转载)
SQL find distinct values in large table (转载)
相关话题的讨论汇总
话题: columns话题: name话题: books话题: table话题: etc
进入JobHunting版参与讨论
1 (共1页)
I**A
发帖数: 2345
1
如果有一个table books,怎么知道这个table有哪些columns, what is the key, etc?
o*o
发帖数: 5155
2
desc books;

etc?

【在 I**A 的大作中提到】
: 如果有一个table books,怎么知道这个table有哪些columns, what is the key, etc?
I**A
发帖数: 2345
3
huh?
i only know "desc" is used to sort the rows.
it can do this too?
what is the output of it?

【在 o*o 的大作中提到】
: desc books;
:
: etc?

c****o
发帖数: 1280
4
you can try
show columns in table_name, for more information check the following page
http://dev.mysql.com/doc/refman/5.0/en/show-columns.html
there should be one column which is designed for the keys

etc?

【在 I**A 的大作中提到】
: 如果有一个table books,怎么知道这个table有哪些columns, what is the key, etc?
t****a
发帖数: 1212
5
show create table books;
d**e
发帖数: 6098
6
Oracle:
最简单是 desc books,
或者 select * from user_tab_columns where table_name = 'BOOKS' 会详细一些。
key之类,可以用这个
select b.constraint_name, b.column_name, b.position
from user_constraints a, user_cons_columns b
where a.constraint_name = b.constraint_name
and a.table_name = 'BOOKS'
order by b.constraint_name, b.column_name, b.position;
其它的database,我想也有类似的

etc?

【在 I**A 的大作中提到】
: 如果有一个table books,怎么知道这个table有哪些columns, what is the key, etc?
I**A
发帖数: 2345
7
thank you all..
"user_tab_columns" is a keyword?

【在 d**e 的大作中提到】
: Oracle:
: 最简单是 desc books,
: 或者 select * from user_tab_columns where table_name = 'BOOKS' 会详细一些。
: key之类,可以用这个
: select b.constraint_name, b.column_name, b.position
: from user_constraints a, user_cons_columns b
: where a.constraint_name = b.constraint_name
: and a.table_name = 'BOOKS'
: order by b.constraint_name, b.column_name, b.position;
: 其它的database,我想也有类似的

d**e
发帖数: 6098
8
属于一个system view,对应login ID
原始应该是 all_tab_columns,column OWNER 可以指定谁的table

【在 I**A 的大作中提到】
: thank you all..
: "user_tab_columns" is a keyword?

I**A
发帖数: 2345
9
en, this one would be the one that they want..

【在 c****o 的大作中提到】
: you can try
: show columns in table_name, for more information check the following page
: http://dev.mysql.com/doc/refman/5.0/en/show-columns.html
: there should be one column which is designed for the keys
:
: etc?

1 (共1页)
进入JobHunting版参与讨论
相关主题
SQL find distinct values in large table (转载)
SQL multiply all values of a column in table (转载)
SQL add some columns into a table from another table
SQL fast search in a 10 million records table
大牛们看看这题:Find Peak Element II
SQL 面试问题
请帮忙回答一个SQL问题
一个F的大数据题
How to design the sql for this problem? (转载)
请问讨论矩阵螺旋打印的链接
相关话题的讨论汇总
话题: columns话题: name话题: books话题: table话题: etc