Viewing 8 posts - 16 through 23 (of 23 total)
USE tempdb
GO
Declare @TotalRows int, @minRow int
CREATE TABLE #Temp
( Id int identity(1,1),
Queue_stub uniqueidentifier
)
INSERT INTO #temp
SELECT Queue_Stub
FROM <table_name> WHERE condition
SET @TotalRows=@@Rowcount
SET @minRow=1
--Using loops
DECLARE @queue_stub uniqueidentifier
SET @queue_stub = ''
WHILE @minRow <=@TotalRows
BEGIN
...
July 18, 2011 at 5:56 am
the query will work as
Select * from <table>
the Or condition Name = 'Bob' is supressed bt the condition 1 = 1.
July 11, 2011 at 5:20 am
exists keyword has its own flaw... you can try the IN keyword( reff in one of the posts)... but make sure to give only 1 select column name in the...
July 6, 2011 at 10:48 pm
try subquery such as --->
SELECT agencyName,agencyId
FROM contactAction
WHERE EXISTS
(
SELECT agencyName,count(*)
FROM contactAction
GROUP BY agencyName
HAVING COUNT(*) <> 1
)
July 6, 2011 at 4:55 am
Viewing 8 posts - 16 through 23 (of 23 total)