13/09/2012, 10:19
|
| Colaborador | | Fecha de Ingreso: agosto-2006 Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 18 años, 3 meses Puntos: 774 | |
Respuesta: Consulta en SQL compleja
SELECT TOP (ABS(CHECKSUM(NEWID())) % 1 + @R )
id,name,lastname,snumber,phone1,phone2,activity,su spect into #temp
FROM employments
WHERE
activity=1
ORDER BY id
select * from #temp
union
SELECT id,name,lastname,snumber,phone1,phone2,activity,su spect
FROM employments
WHERE
suspect=1
drop table #temp
saludos!
:)
__________________ What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me |