SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 sql
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mana
Yak Posting Veteran

86 Posts

Posted - 07/25/2014 :  07:13:13  Show Profile  Reply with Quote
Hello I have the below code but the result is not that i want
can you helo me please?
UPDATE AMPPU_Alle_Fehlteile SET
summenew2 = avg_bereich
FROM AMPPU_Alle_Fehlteile A
INNER JOIN (select Offline_date,Bereich,AVG(ARTPU1) AS avg_bereich FROM
AMPPU_Alle_Fehlteile group by Offline_date,Bereich,
YEAR(Offline_date), MONTH(Offline_date)) B
ON MONTH(A.Offline_date) = MONTH (B.Offline_date) and
YEAR(A.Offline_date) = YEAR(B.Offline_date) ;

gbritton
Flowing Fount of Yak Knowledge

1109 Posts

Posted - 07/25/2014 :  09:29:39  Show Profile  Reply with Quote
To hello you with this, please post:

1. CREATE TABLE commands to create the tables for your query
2. INSERT INTO commands to populate the tables with test data
3. The results you are getting from your query when executed against these tables
4. The results you want.
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37133 Posts

Posted - 07/25/2014 :  12:31:21  Show Profile  Visit tkizer's Homepage  Reply with Quote
http://www.sqlservercentral.com/articles/Best+Practices/61537/

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000