Kod: Tümünü seç
select ih.id as invoice_id,c.id as client_id,p.id as product_id,il.id as invl_id,ih.inv_date, ih.inv_type,
case ih.inv_type
when 1 then "ALIS FATURASI"
when 2 then "ALIS IADE FATURASI"
when 3 then "SATIS FATURASI"
when 4 then "SATIS IADE FATURASI"
when 5 then "HIZMET FATURASI"
when 6 then "ITHALAT FATURASI"
when 7 then "IHRACAT FATURASI"
when 8 then "IPTAL FATURASI"
END as invtip, ih.inv_no,c.cl_name,p.cod, p.descriere,il.adet,il.unit_price,il.line_net,il.line_vat,il.line_grand,ih.exch_rate,il.crn from inv_header ih
left join inv_lines il on ih.id=il.fat_id
left join clients c on ih.client_id=c.id
left join produse p on p.id=il.code_id where p.cod not like 'X%'
group by invl_id ORDER BY ih.inv_date DESC, invoice_id DESC, invl_id ASC
Kod: Tümünü seç
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause).