Как в запрос добавить условия ??
Добавлено: 31 май 2005, 18:25
есть такой запрос:
какие есть функции или способы заменить эту конструкцию в обычном запросе ??
или подскажите есть функция по типу isnull ??
Код: Выделить всё
select job.jobid
, Servicetype.description as servicetype
, if(b.offeramount is null) then 0 else s.billamount*100/b.offeramount end
, s.paymenttotal
, s.checkdate
, s.invoicemaileddate
, 'open' as servicestatus
from job j, service s, servicetype st, buyout b
where 1 = 1
and s.jobid = j.jobid
and st.servicetypeid = s.servicetypeid
and b.serviceid = s.serviceid
and s.cancelleddate is null
and b.offeramount is not null
Код: Выделить всё
if(b.offeramount is null) then 0 else s.billamount*100/b.offeramount end
или подскажите есть функция по типу isnull ??