0
我有2個疑問:的Informix:查詢合併
select COUNT(o.id_offer) from offers o, product p where
p.id_product = "+ productID +" and o.id_offer = "+ offerID +" and (b.type = 0 or o.type = "A")
該查詢返回一些產品的數量
select p.id_product, p.name, s.id_supplier, s.name from product p, suppliers s where p.id_supplier = s.id_supplier
這個查詢返回的所有產品數據
我希望將二者結合起來在一個查詢,如下所示:
select (select COUNT(o.id_offer) from offers o, product p where
p.id_product = p.id_product and o.id_offer = 13345 and (b.type = 0 or o.type = "A")) count,p.id_product, p.name, s.id_supplier, s.name from product p, suppliers s where p.id_supplier = s.id_supplier
任何人都知道如何在informix中做到這一點?
你爲什麼標籤這個'mysql'如果它是關於Informix? – Barmar 2014-10-03 03:15:36
對不起,謝謝修復它 – tck 2014-10-03 03:24:44
這是一個常見的錯誤,出於某種原因。你能解釋你爲什麼這麼做嗎? – Barmar 2014-10-03 03:26:14