avatar
A rookie's query question# Database - 数据库
M*7
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?
avatar
h*n
2
ok once again, what do you exactly want? pick 2 ints of col2 and then...
avatar
B*g
3
co-ask

【在 h****n 的大作中提到】
: ok once again, what do you exactly want? pick 2 ints of col2 and then...
avatar
M*7
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
avatar
B*g
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

avatar
h*n
6
有点像data warehouse的特定时间段or events消费行为分析
avatar
W*r
7
I would just read the table into memory and implement your logic in java.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。