select a.ICCID,b.STB_NO
from ir_ic_card_info_t a,ir_stb_info_t b
where a.city_code= '119'
and a.city_code=b.city_code
and a.RESOURCE_KIND= '10102'
and b.RESOURCE_KIND= '20204'
and a.use_status=0
and b.use_status=0
and a.belongs_to= '10023'
and a.belongs_to=b.belongs_to
and rownum<= 10 这个语句查完A表字段数据正常,但B表字段数据却都是重复的。求解啊!
from ir_ic_card_info_t a,ir_stb_info_t b
where a.city_code= '119'
and a.city_code=b.city_code
and a.RESOURCE_KIND= '10102'
and b.RESOURCE_KIND= '20204'
and a.use_status=0
and b.use_status=0
and a.belongs_to= '10023'
and a.belongs_to=b.belongs_to
and rownum<= 10 这个语句查完A表字段数据正常,但B表字段数据却都是重复的。求解啊!
是一对一,一对多,还是多对多
B表有重复数据,说明B表一条数据对应A表多条数据了
where条件里面去控制吧