select * from promobanr p join tovar on (kodt=2876 and kodt in(p.id_tovar)) where p.mesto=1 and p.activn =1 and p.databeg < now() and now() < p.datafin order by p.databeg desc
stuff //товары banner
id| price| ... и т.д. id|width|height| ... и т.д.
| |
| stuffToBanner |
|____stuffID | bannerID___________| // и эта комбинация должна быть PK,
// FK на "stuff.id" и FK на "banner.id"