DO CASE
CASE Thisform.cost1_for_agent.value = 0
DO CASE
CASE Thisform.find_goods.Value = 1
set step on
select goods_name, model, producer, suppler, cost from agent;
inner join goods on goods.goods_id=agent.goods_id;
inner join producers on producers.produce_id=goods.produce_id;
inner join supplers on supplers.suppler_id=goods.suppler_id;
where cost=(select max(cost) from agent)
CASE Thisform.find_goods.Value = 2
select goods_name, model, producer, suppler, cost from agent;
inner join goods on goods.goods_id=agent.goods_id;
inner join producers on producers.produce_id=goods.produce_id;
inner join supplers on supplers.suppler_id=goods.suppler_id;
where cost=(select min(cost) from agent)
CASE Thisform.find_goods.Value = 3
select avg(cost) as "Ñðåäíÿÿ_ñòîèìîñòü" from agent
ENDCASE
CASE Thisform.cost1_for_agent.value = 1
DO CASE
CASE Thisform.find_goods.Value = 1
select surname, goods_name, model, producer, suppler, cost from agent;
inner join goods on goods.goods_id=agent.goods_id;
inner join producers on producers.produce_id=goods.produce_id;
inner join supplers on supplers.suppler_id=goods.suppler_id;
where cost=(select max(cost) from agent where surname=thisform.c1_agent.value)
CASE Thisform.find_goods.Value = 2
select surname, goods_name, model, producer, suppler, cost from agent;
inner join goods on goods.goods_id=agent.goods_id;
inner join producers on producers.produce_id=goods.produce_id;
inner join supplers on supplers.suppler_id=goods.suppler_id;
where cost=(select min(cost) from agent where surname=thisform.c1_agent.value)
CASE Thisform.find_goods.Value = 3
select avg(cost) as "Ñðåäíÿÿ_ñòîèìîñòü" from agent where surname=thisform.c1_agent.value
ENDCASE
ENDCASE
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.