CREATE OR REPLACE VIEW adempiere.RV_Questionnaire AS
SELECT 
  q.Q_Questionnaire_ID AS Q_Questionnaire_ID,
  q.AD_Client_ID AS AD_Client_ID,
  q.AD_Org_ID AS AD_Org_ID,
  q.IsActive AS IsActive,
  q.C_BPartner_ID AS C_BPartner_ID,
  bp.C_BP_Group_ID AS C_BP_Group_ID,
  q.AD_User_ID AS AD_User_ID,
  q.IsMan AS IsMan,
  q.Date1 AS Date1,
  q.Birthday AS Birthday,
  q.M_Product_ID AS M_Product_ID,
  p.M_Product_Category_ID AS M_Product_Category_ID,
  q.M_Product2_ID AS M_Product2_ID,
  p2.M_Product_Category_ID AS M_Product2_Category_ID,
  q.Price AS Price,
  q.Price2 AS Price2,
  q.Description AS Description
FROM adempiere.Q_Questionnaire q
	INNER JOIN adempiere.C_BPartner bp on(q.C_BPartner_ID=bp.C_BPartner_ID)
 	left Outer Join adempiere.M_Product p on(q.M_Product_ID=p.M_Product_ID)
	left Outer Join adempiere.M_Product p2 on(q.M_Product2_ID=p2.M_Product_ID)

;