Assuming that your sql engine (you haven't told us which engine you use) has AVG and STD aggregation functions, you are a little bit out of the line with this question. You confuse an sql query with a report. A query returns a set, thus it is unordered by definition. So assuming that you get the calculation, you can end up with a result like this:
name Tag Value AVG STD
AIM 00900AAC2 96
AIM 00900AAC2 96.76 96.59 0.43
AIM 00900AAC2 97
ARE NULL 97
ARE NULL 98.5 97.75 0.75
Now let's take the other problem, if you want to stick to the "result" you posted: You can easily generate a result like this:
name Tag Value AVG STD
AIM 00900AAC2 96 96.59 0.43
AIM 00900AAC2 96.76 96.59 0.43
AIM 00900AAC2 97 96.59 0.43
ARE NULL 97 97.75 0.75
ARE NULL 98.5 97.75 0.75
by adding subquery (not tested - and only to get the idea):
select
[Name],
[Tag],
[Value],
(select AVG([value]) from [dbo].[database_data] t2 where t2.name=t2.name) as AVG,
(select STDEV([value]) from [dbo].[database_data] t2 where t2.name=t2.name) as STD
from [dbo].[database_data] t1
But it is really hard to have the aggregations result shown only for the first row of every group - and let's say nulls elsewhere. An sql query is just not meant to do this. You really should handle this on the presentation layer, whatever that is.