Как переработать запрос так, чтобы вмето where x=1 or x=2 or x=3 вітянуть селектом из таблицы Table1 все значения для x?
Table 1 x 1 2 3
| Код | create table #tt_tmc( xpost_id numeric(20,0), xpost_date datetime, code varchar(20), name varchar(50))
insert into #tt_tmc(xpost_id, xpost_date, code, name) select xpost.id, xpost.postingdate, ac_tmc.code, ac_tmc.name from ac_xposting xpost, ac_xpostseries xpost_ser, ac_xselanalytics xsel_anal, -- ac_oscard, ac_account adeb, ac_account acred, ac_tmc where xpost.id = xpost_ser.posting_id and xpost.debet = adeb.id and xpost.credit = acred.id and xpost_ser.SERIE_ID = xsel_anal.SERIE_ID and -- ac_xselanalytics.ANALYTICS_ID = (aeae aiaeeoeee IN) and -- ac_xpostseries.ISCREDIT = 1 and xsel_anal.ELEMENTANALYTIC = ac_tmc.id and ac_tmc.code = '4554534' or ac_tmc.code = '11321' and acred.code like '63/%'
|
|