SQL Server 2008 : SELECT min(date) -
i'm trying simple select statement i'm having hard time doing it.
i have table these columns:
companyid, companydept, dateadded
i'm trying select statement this...
select companyid, companydept min(dateadded)
so there multiple dates dateadded
- i'm trying select companydept
, companyid
earliest dateadded
.
edit: select companyid, companydept dateadded=min because there might 3 or more dates such 10/1/2015, 11/12/2015, 1/4/2016 -(rows of data mean) i'm trying select date looking @ earliest possible date (10/1/2016)
you can try getting first record using top 1 , ordering date.
select top 1 companyid, companydept table order dateadded
Comments
Post a Comment