Viewing 15 posts - 6,616 through 6,630 (of 8,731 total)
So based on that sample data, what's your expected output?
Does this help?
WITH CTE AS(
select *, DENSE_RANK() OVER(PARTITION BY Segment ORDER BY deptno) rankno
from #check1
)
UPDATE CTE SET
SetColumn = rankno
SELECT *
FROM #check1...
April 2, 2014 at 12:30 pm
You didn't follow the advice correctly.
You might need to use a ranking function to update your table but without ddl, sample data and expected results I can't be sure about...
April 2, 2014 at 11:46 am
Sean Lange (4/2/2014)
Luis Cazares (4/2/2014)
April 2, 2014 at 11:43 am
I believe that there's an error in the logic of the trigger since there's no change in the data. If the information hasn't changed, then the datechanged value shouldn't change...
April 2, 2014 at 11:32 am
anil.varghese (4/2/2014) (From PM)
Thanks for your assistance. I believe I do understand what you are doing. This is new to me, so if there is some documentation on what you...
April 2, 2014 at 10:03 am
If you used 2-part names for your columns, it should become clear.
select *
from #Table1 t1
where t1.mykey in (select t1.mykey from #BadLookup bl)
It might look weird that the subquery is...
April 2, 2014 at 9:46 am
It seems that "Active Threads" will show you the threads with a post since the last time you closed your browser. If it doesn't show enough threads, you could use...
April 2, 2014 at 9:41 am
I'm glad that you could get it done and it's even better to know that you're aware of this terrible design.
Good luck with this project (you'll need it).
April 2, 2014 at 9:29 am
anil.varghese (4/2/2014)
Thanks, this worked great. As to a response to a previous question, A promotion is identified by a change in title and the year of that change.
That's great!...
April 2, 2014 at 9:24 am
You shouldn't look at the subtree cost, that's an estimated value not a real one.
If you have an index on enddate, you might see a change from an index seek...
April 2, 2014 at 9:21 am
GilaMonster (4/2/2014)
Guideline for python code:
"Explicit is better than implicit"
I can agree with that, it's something I argue for when teaching T-SQL. Be explicit.
Then, from the style guide for python:
Bad form:
if...
April 2, 2014 at 9:18 am
RonKyle (4/2/2014)
there are tasks which do justify the use of cursors
I'm sure this is true, but I haven't run into one yet. Once I thought I had, but...
April 2, 2014 at 9:09 am
Something like this?
WITH CTE AS(
SELECT *,
ROW_NUMBER() OVER( PARTITION BY OrderID, ItemType ORDER BY OrderDate DESC, OrderTime DESC) rn
FROM @MySampleOrders
)
SELECT *
FROM CTE
WHERE rn = 1
April 1, 2014 at 4:25 pm
You might be able to use the Quirky update[/url] or the LEAD/LAG functions available on 2012.
However, I did this using an islands solution that might fit your problem.
WITH Groups AS(
SELECT...
April 1, 2014 at 3:41 pm
I'm not sure that I agree with Eirikur about saying "it depends". I'm sure that cursors are always hard on servers, but some methods can be worse (e.g. triangular joins)...
April 1, 2014 at 3:06 pm
Viewing 15 posts - 6,616 through 6,630 (of 8,731 total)