由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - A rookie's query question
相关主题
菜鸟问题,急请教一个query 优化的问题(filter keyword)
sql query help请教一个SQL的问题
问个sql/ ssis的问题 谢谢!sort two same tables SQL but different results
一个oracle performance 的问题。SQL copy a table into a new table and add a new column
高手请进请问sql 有条件性的select columns
any group function reutrn null if there is null value?如何除去duplicate rows?
sql 题目求助请教一个sql问题
谁能帮我看看这个Insert语句要怎么改一下?sql 请教
相关话题的讨论汇总
话题: a1话题: col2话题: table话题: a2话题: query
进入Database版参与讨论
1 (共1页)
M***7
发帖数: 2420
1
Hi all. I am a newbie with SQL. Here is my question:
The table is like
col1 col2 col3
a1 1 c
a1 2 a
...
a1 100 t
a2 1 d
a2 2 c
...
a2 100 g
a3 1 h
...
a3 100 d
now I am trying to make a function. The parameters are 2 ints of col2(such
as 2,81). I want to return a table containing the composition of that two
input parameters which is like
for parameter (2,81)
dt 10%
ac 40%
tt 50%
could anyone help me out?
h****n
发帖数: 101
2
ok once again, what do you exactly want? pick 2 ints of col2 and then...
B*****g
发帖数: 34098
3
co-ask

【在 h****n 的大作中提到】
: ok once again, what do you exactly want? pick 2 ints of col2 and then...
M***7
发帖数: 2420
4
Sorry for the confusion.
this query is like suppose I have a sequence a1 with "agdgteddgg", then I
put it into the table as below:
col1 col2 col3
a1 1 a
a1 2 g
a1 3 d
...
a1 10 g
then I get 9 other different sequences (a2-a10) and put them into the table
in the same format.
Then I want to check for all sequences, what is the combination of
composition at position 2 and position 8.
so it could be
B*****g
发帖数: 34098
5
what DB?
which version?
Is every sequence length is 10?
其实,self join就行了

table

【在 M***7 的大作中提到】
: Sorry for the confusion.
: this query is like suppose I have a sequence a1 with "agdgteddgg", then I
: put it into the table as below:
: col1 col2 col3
: a1 1 a
: a1 2 g
: a1 3 d
: ...
: a1 10 g
: then I get 9 other different sequences (a2-a10) and put them into the table

h****n
发帖数: 101
6
有点像data warehouse的特定时间段or events消费行为分析
W*******r
发帖数: 15
7
I would just read the table into memory and implement your logic in java.
1 (共1页)
进入Database版参与讨论
相关主题
sql 请教高手请进
问个简单的sql语句any group function reutrn null if there is null value?
请教几个面试题sql 题目求助
mySQL 问题 (转载)谁能帮我看看这个Insert语句要怎么改一下?
菜鸟问题,急请教一个query 优化的问题(filter keyword)
sql query help请教一个SQL的问题
问个sql/ ssis的问题 谢谢!sort two same tables SQL but different results
一个oracle performance 的问题。SQL copy a table into a new table and add a new column
相关话题的讨论汇总
话题: a1话题: col2话题: table话题: a2话题: query