I want to create View with my sql query like this : CREATE VIEW IF NOT EXISTS view_table_status AS Select a.AreaId, a.AreaName, OrderId, t.AccountId, t.AccountNo, Amount, CustomerId, CustomerName, CustomerCategoryId, CustomerCategoryName, i.DispStatus, t.LocationId, LocationName, TotalAmount, OrderCode, OrderFullName, t.TableId, t.TableName, TableTypeId, ProductAmount FROM tbl_tables t LEFT JOIN tbl_areas a ON t.AreaId=a.AreaId LEFT OUTER JOIN tbl_orders i ON t.TableId=i.TableId AND (i.DispStatus='4' OR i.DispStatus='2' OR i.DispStatus='5');
I want to create View with my sql query like this : CREATE VIEW IF NOT EXISTS view_table_status AS Select a.AreaId, a.AreaName, OrderId, t.AccountId, t.AccountNo, Amount, CustomerId, CustomerName, CustomerCategoryId, CustomerCategoryName, i.DispStatus, t.LocationId, LocationName, TotalAmount, OrderCode, OrderFullName, t.TableId, t.TableName, TableTypeId, ProductAmount FROM tbl_tables t LEFT JOIN tbl_areas a ON t.AreaId=a.AreaId LEFT OUTER JOIN tbl_orders i ON t.TableId=i.TableId AND (i.DispStatus='4' OR i.DispStatus='2' OR i.DispStatus='5');
Anyone help me how i can do it with activeRecord