SQL创建视图语句

时间:2017-09-07 09:36:53

标签: sql oracle sql-view

我是SQL Developer的新手。我必须创建一个接近的视图 下面的示例输出列表:

enter image description here

表结构是:

SITE(Site_ID, Region, Description, Latitude, Longitude, Altitude); 
MEASUREMENT(Site_ID, Recorded_On, Name, Value, Outlier_Indicator);

这是我的脚本,它按照我的建议工作。

create view Site_Outlier_Incidents AS 
    select 
        Site_ID, Name, Outlier_Indicator,
        count (SITE.Site_ID) as Number_Of_Incidents
    from Site SITE
    left join Measurement MEASUREMENT on MEASUREMENT.site_ID = SITE.Site_ID
    where Name = 'E.Coli'
    group by
        Site_ID, Name, Outlier_Indicator;

1 个答案:

答案 0 :(得分:1)

使用 [HttpGet] [ActionName("Index")] [HandleError] public ActionResult Index_Get(string submit) { bool ParamsChanged = mySessionObject.Parameters.LoadQueryParameters(Request); if (ParamsChanged) return RedirectToAction("Index", mySessionObject.Parameters.GetQueryParameters()); LoadHotelDetails(); GetHotelAvailability(); ViewBag.data = TempData["verification_errors"]; return View("Index",myViewModel); } 代替create or replace view