Viewing 15 posts - 736 through 750 (of 2,171 total)
Two things... Your IN statements and you UNION statement s probably what's killing you.
Try EXISTS instead of IN, and try using UNION ALL of there can be no duplicates between...
August 22, 2008 at 10:27 pm
Oh man, those memories from Math 101 lessons...
😀
August 22, 2008 at 9:26 am
A workaround can be to concatenate the two values into a binary string or varchar, and then later split the values in the SELECT statement.
August 22, 2008 at 9:24 am
Which service pack, if any, are you using on the SQL Server?
August 20, 2008 at 3:11 pm
August 19, 2008 at 12:39 pm
You're welcome.
I forgot to mention
BETWEEN
NOT BETWEEN
as two more potential "triangular join" triggers.
August 19, 2008 at 7:36 am
There is a real difference when running a concatenating code in SQL Server 2000 and SQL Server 2005.
SQL Server 2005 displays the "erratic" behaviour you describe such as only returning...
August 19, 2008 at 4:35 am
See code above from Jack Corbett.
Is does everything you need and not using dynamic sql.
August 19, 2008 at 4:28 am
You find that WHILE with IF easier than this?
DECLARE @Loop INT
SET @Loop = 1
WHILE @Loop <...
August 19, 2008 at 2:41 am
Learn you JOINs
Select L.BdKey
From ArLine L
Join ArInvoice V On
L.ArVKey = V.ArVKey
And V.ArVType = 9
Where L.BdKey Is Null
August 18, 2008 at 10:22 am
Easy.
Look at the
1) JOIN arguments
2) WHERE arguments
3) Correlated subqueries arguments
Equal character "=" only are most often OK, but the character combinations to look for are mostly
>
>=
<
<=
<> or !=
Haven't you...
August 18, 2008 at 5:35 am
DECLARE@Loop INT,
@Value VARCHAR(3)
SELECT@Loop = 1,
@Value = NumberValue
FROMNumber
WHERENumberID = 1
WHILE @Loop < 8
BEGIN
PRINTREPLICATE(@Value, 4 - ABS(4 - @Loop))
SET@Loop = @Loop + 1
END
August 18, 2008 at 5:29 am
UNIONs? IFs?
DECLARE@Loop INT
SET@Loop = 1
WHILE @Loop < 8
BEGIN
PRINTREPLICATE('1', 4 - ABS(4 - @Loop))
SET@Loop = @Loop + 1
END
SELECTREPLICATE('1', 4 - ABS(4 - Number))
FROMmaster..spt_values
WHEREType = 'P'
AND Number BETWEEN 1 AND 7
August 18, 2008 at 5:00 am
No need for calendar table.
This question is also asked and answered here
August 17, 2008 at 2:37 am
Viewing 15 posts - 736 through 750 (of 2,171 total)