Why not generate the required results in a SELECT then update from
that. row_number() could allow you to generate a random number to each
giver, then we can generate another random number and join to each
random number. That'll give you a giver and recipient combination.
e.g:
select giver,r
On Tue, Dec 22, 2015 at 9:49 PM, Lou Duchez wrote:
> I have a company with four employees who participate in a Secret Santa
> program, where each buys a gift for an employee chosen at random. (For now,
> I do not mind if an employee ends up buying a gift for himself.) How can I
> make this work
Lou Duchez schrieb am 23.12.2015 um 04:49:
I have a company with four employees who participate in a Secret
Santa program, where each buys a gift for an employee chosen at
random. (For now, I do not mind if an employee ends up buying a gift
for himself.) How can I make this work with an SQL stat
On Wed, Dec 23, 2015 at 04:32:34AM -0500, Lou Duchez wrote:
> >Of course: you can't UPDATE a field with a query returning more than one
> >result, as you can check easily trying:
>
> I understand that, and my query does not return more than one result. The
> problem is that it returns THE SAME re
Of course: you can't UPDATE a field with a query returning more than one
result, as you can check easily trying:
I understand that, and my query does not return more than one result. The
problem is that it returns THE SAME result each time, most likely because the
subquery is evaluated exactl
On 23 December 2015 at 16:49, Lou Duchez wrote:
> I have a company with four employees who participate in a Secret Santa
> program, where each buys a gift for an employee chosen at random. (For
> now, I do not mind if an employee ends up buying a gift for himself.) How
> can I make this work wi
On 23 December 2015 at 16:49, Lou Duchez wrote:
> I have a company with four employees who participate in a Secret Santa
> program, where each buys a gift for an employee chosen at random. (For
> now, I do not mind if an employee ends up buying a gift for himself.) How
> can I make this work wi
I have a company with four employees who participate in a Secret Santa
program, where each buys a gift for an employee chosen at random. (For
now, I do not mind if an employee ends up buying a gift for himself.)
How can I make this work with an SQL statement?
Here is my Secret Santa table: