372 | | }}} |
| 374 | == [=#point7] Сховати товари по яким не бул жодного руху == |
| 375 | |
| 376 | {{{ |
| 377 | update t_nomens uu |
| 378 | set IS_ACTIVE = 0, IS_VISIBLE = 0 |
| 379 | where uu.nomen_id in (select t.nomen_id from t_nomens t left join t_goods n on t.nomen_id= n.nomen_id |
| 380 | where ((IS_ACTIVE = 1)or (IS_VISIBLE =1) ) and goods_id is null) |
| 381 | }}} |
| 382 | |
| 383 | == [=#point8] Проставити останього постачалька в якості основного == |
| 384 | |
| 385 | {{{ |
| 386 | update t_nomens uu |
| 387 | set uu.src_client_id = (select first(1) clients_id |
| 388 | from t_goods pp |
| 389 | where pp.nomen_id = uu.nomen_id and pp.clients_id > 100 order by pp.goods_id desc) |
| 390 | where uu.nomen_id in (select distinct t.nomen_id from t_nomens t join t_goods n on t.nomen_id= n.nomen_id |
| 391 | where n.clients_id > 100 ) |
| 392 | }}} |
| 393 | |
| 394 | }}} |