Total Do anyone knows how can I solve this problem having good performance. Juan Mellado Gerardo Abdo Gerardo Abdo 1, 3 3 gold badges 10 10 silver badges 16 16 bronze badges. Can you describe what you're trying to do here? I'll try to help you re-write the query, but I can't figure out what you're trying to accomplish. Since the table names aren't meaningful, maybe you can at least give a list of columns in each and a sample of the data you're looking at.
Add a comment. Active Oldest Votes. Code Magician Code Magician What's with the semicolon at the start of ;with counts , does that serve a purpose other than closing the previous statement?
Semicolons are optional in T-sql so the parser has to infer where semicolons should go. If there is a select statement immediately preceeding the CTE, it's ambigious to the parser if with is part of the previous statement or it's own.
It's been adopted as a convention to prevent any parsing issues. The join solves the "total in Group on the key and then join. Find centralized, trusted content and collaborate around the technologies you use most. Connect and share knowledge within a single location that is structured and easy to search.
How would I change the above to a update with group by instead of insert with group by based on the criteria tableB. Is this what you want? This will get for each columnA the C. Column1 min value, and will update it in A. Column1 that's where you were inserting before , based on condition A. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 9 years, 4 months ago. Active 9 years, 4 months ago. Answered by:. Archived Forums. This is the place for advice and discussions 0 0. Sign in to vote. Saturday, September 29, PM. McCarthy 0. Code Block. John V. On another related note, how do you think the best way to deploy this code would be? Monday, October 1, PM.
0コメント