sql查询求指导
sql吧
全部回复
仅看楼主
level 1
多点商贸 楼主
Q1:: 查询pid为1-10的word 并写出任意一个W1为word时的W2的word
数据表
TABLE A1
PIDWORDOCC
1 Book 25
2 bee 28
3 pen 32
4 dog 17
5 my 12
6 you 31
7 he 33
8 she 22
9 her 126
10 apple 1265
...
9999dsaf12654
TABLE B1
W1W2OCC1
1 2 12
1 5 22
1 6 125
1 8 13
2 4 18
2 15 188
3 24 198
3 15 12
4 17 133
4 22 125
5 12 155
...
999989771553
注:
A1.PID=B1.W1
A1.PID=B1.W2
查询结果应为:
pidWORD W1 W2
1 Book Book bee
2 bee bee dog
... .........
10
2022年12月15日 03点12分 1
level 1
发不出来 语句 laji 贴吧[汗]
2022年12月15日 08点12分 3
select t.*,a1.word from a1,(
2022年12月15日 08点12分
@_forever_允儿 select a1.pid,a1.word,b1.w2 from a1,b1 where
2022年12月15日 08点12分
@_forever_允儿 a1.pid=b1.w1 and a1.pid<=10)t where a1.pid=t.w2
2022年12月15日 08点12分
1