Viewing 15 posts - 4,351 through 4,365 (of 5,504 total)
Yes, it's possible.
You need to do a self join on the table on id=id-1 (or based on row_number(), if there are gaps in the id values).
For a more detailed answer...
February 4, 2010 at 10:21 am
You have to define the recipients outside of the @query parameter.
I'd use that query to build a temp table and assign the related value to @recipients.
@query then would be something...
February 3, 2010 at 5:28 pm
I'm not sure if I'm heading in the right direction...
If you want to see all order numbers with different values then you could use something like the following (untested, since...
February 3, 2010 at 5:23 pm
You could create a role for that user (and any other user you'd like to add).
Create views or stored procedures or functions for those user and lock down all tables.
Within...
February 3, 2010 at 4:03 pm
BaldingLoopMan (2/3/2010)
trying to wrap my mind around what u guys did....
You might want to have a look at Lynns blog to find some helpful date routines.
February 3, 2010 at 3:52 pm
Yes, I'd wrap it into a procedure with proper transaction and error handling (TRY ... CATCH).
But the major question remains and needs to be considered: How can it be guaranteed...
February 3, 2010 at 3:42 pm
Lynn Pettis (2/3/2010)
Congrats Jack!! :w00t:I feel slighted, only 1 person even acknowledge when I hit 10,000. 🙁
Rumor says there are advantages and disadvantages to climb up to the gods... 😉
Don't...
February 3, 2010 at 3:20 pm
lmu92 (2/3/2010)
I guess the reason why Steve voted for Golf clap is that Jack didn't get to the "SQL Olympian gods" yet. So he can go from Golf clap...
February 3, 2010 at 3:18 pm
CirquedeSQLeil (2/3/2010)
...No. Golf clap. Expression used for how one claps semi-quietly on the golf course. I believe there is a line from CaddyShack about it.
I guess the...
February 3, 2010 at 3:11 pm
A few things up front:
#1: You did a good job the way you provided table defs and sample data!! 🙂 Made it easy to work on. And I'm sure you...
February 3, 2010 at 3:03 pm
Totally Off-topic:
Did you notice? Jack is "SSCrazy Eights" now.
Congrats from across the ocean!
February 3, 2010 at 2:25 pm
I'm not sure why the values of your column [parentId] are identical to the values of the ID column... Looks redundant, which is obviously not the purpose.
Please provide more details...
February 3, 2010 at 2:02 pm
Sounds like an issue that fits into the "running total" category.
February 3, 2010 at 1:28 pm
Something like
With CTE as
(
Select a2.* from a1
inner join a2
on a1.col=a2.col
),
CTE2 as
(
Select a4.* from a3
inner join a4
on a3.col=a4.col),
CTE3 as
(
Select a5.* from CTE1
inner join a5
on CTE1.col=a5.col
)
Select cte3.* from cte
inner join...
February 2, 2010 at 4:31 pm
Could you possibly post some of the date values as stored in the table?
Maybe you're struggling with issues related to the way the values are stored:
Example:
If data would be stored...
February 2, 2010 at 2:36 pm
Viewing 15 posts - 4,351 through 4,365 (of 5,504 total)