Viewing 15 posts - 751 through 765 (of 1,347 total)
Take a closer look at this:
SELECT RMSFILENUM,
rmsbalance
FROM RFINANL a
where rmstrandte = (select max(rmsbalance) from RFINANL)
and
cast(rmstrandte as char(8)) + cast(rmstrantim As...
January 10, 2006 at 3:25 pm
The expression "AND rf10.rmsbalance <> 0.00" belongs in a WHERE clause, not a HAVING.
Also, since you are storing date and time separately, taking a max of both independantly...
January 10, 2006 at 2:48 pm
Also you have a non-aggregate expression in your hAVING, are you sure that isn't the cause of the syntax error ?
January 10, 2006 at 2:26 pm
What are the datatypes of the 2 columns rmstrandte and rmstrantim ?
January 10, 2006 at 2:22 pm
>>SELECT a.KeyColumn
>>FROM @tablea As a
>>LEFT JOIN (SELECT * FROM @tableb WHERE b.SomeColumn = 'B') b
>>ON a.KeyColumn = b.KeyColumn OR b.KeyColumn IS NULL
That returns all four rows. Which is incorrect.
January 10, 2006 at 2:01 pm
I'm seeing "IF" statements that are missing a "BEGIN", so that the conditional applies to the next statement only, and not the entire indented block. I think thats' where your...
January 10, 2006 at 12:21 pm
Thanks for proving my point. In the example below, you get the wrong resultset using a LEFT JOIN and a filter in the WHERE, even if you do phrase it...
January 10, 2006 at 11:27 am
Which columns are being updated ?
Are any of the updated columns part of the clustered index ? Are they part of other indexes ?
January 10, 2006 at 10:53 am
I have never observed a LEFT JOIN checking for NULL behave any differently than a NOT EXISTS in terms of query plans.
What I have observed are some nasty insidious bugs...
January 10, 2006 at 10:47 am
Is the number column unique in Table1 ? Unique in Table2 ?
January 10, 2006 at 10:37 am
So, the expression:
(rf.rmstranamt - rf.rmstranamt10) AS [Current Balance]
... is Current Balance ? And you want to filter on it by comparing it to the top 1 of another sub-query...
January 10, 2006 at 9:11 am
Interesting.
I decided to use the 1st 6 characters of a GUID.
Set NoCount On
Declare @Count int
Set @Count = 0
Declare @NextString varchar(6)
Declare @TestTable Table (
Column1 Varchar(6) Not Null primary key clustered
)
While...
January 9, 2006 at 2:24 pm
You should probably use SQL Server Profiler and trace at the SQL Server level rather than the operating system to determine what SQL is coming from the app to the...
January 9, 2006 at 11:52 am
>>all works tickety boo
Heh, until the tables get large enough and those cursor-like sub selects start running like molasses 🙂
January 6, 2006 at 11:22 am
Well, I kinda hoped you would look through the DDL and compare it to your INSERT statement.
eg:
[STATE] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
State is varchar(2)
Look what you're trying to...
January 6, 2006 at 11:20 am
Viewing 15 posts - 751 through 765 (of 1,347 total)