RE: SQL problem
Posted in 1997
Topics: General Discussion
the data model is bad..you must be unit price and cost of sales in the same row or you have many kins of cost price?.., not with one view.... but the view for sql solution is select a.invoice#, a.line#, a.cost unit_price, b.cost cost_of_sales from table a, table b where a.invoice = b.invoice and line# = line# and a.cost_type <> b.cost_type and a.cost_type = "unit price" ---------- } De: Peter Marley <peter.marley@acco-uk-co.uk> } A: informix-list@rmy.emory.edu } Asunto: SQL problem } Fecha: Wednesday 19 de November de 1997 12:44 } } I have to create a view that extracts its information from one table } and generates one row in the view per invoice in the table. Is this } possible in SQL? } } Example: } Table has the following columns: } } invoice# line# cost type cost } 00001 001 unit price 100 } 00001 001 cost of sales 200 } } } Can I create the following view: } } invoice# line# unit price cost of sales } 00001 001 100 200 } } } Any help would be appreciiated, } } Thanks } } Peter } } __________________________________ } Peter Marley } DataBase Manager, Acco UK Ltd } Tel: +44 (0)1296 397444 ext. 4098 } Fax: +44 (0)1296 311019 } email: peter.marley@acco-uk.co.uk }