Viewing 15 posts - 1,006 through 1,020 (of 1,216 total)
Well, the problem seems to be that we don't know for sure how many columns there will be. Do YOU know that? If not, then you can't do it in...
April 28, 2005 at 2:01 am
Hello,
I'm not sure I understood fully your requirement, but here goes... this will produce the same result as you posted, based on supplied data.
SELECT TradeDate, Symbol, OpenPrice, PercentChange
FROM EODDetail eod
WHERE...
April 26, 2005 at 1:49 am
Here is just one example how IDENTITY does not guarantee uniqueness:
CREATE TABLE #t(a int IDENTITY, b varchar(5))
INSERT INTO #t VALUES ('ss')
INSERT INTO #t VALUES ('ab')
SET IDENTITY_INSERT #t ON
INSERT INTO #t (a,b) VALUES (1,...
April 26, 2005 at 1:15 am
Now, that's interesting, Farrell... I always assumed that there is no need to use TOP 1 in EXISTS clause, since the EXISTS itself requires only 1 matching record to return...
April 25, 2005 at 1:04 am
Since the column is rather short (NVARCHAR(32)), I would suggest adding a length check to avoid problems when trying to add another character to entry that already is at maximum...
April 22, 2005 at 1:11 am
Operator (probably "AND") is missing in one of the WHERE clauses between the two conditions for date:
tt.type='PR' and
tp.time>'01/13/04'
tp.time<'05/15/04'
group by pr.name
April 22, 2005 at 12:57 am
Just what does it mean "by date"? In case you need to find out what the totals were at a certain date, then it shouldn't be too complicated. BTW, you...
April 21, 2005 at 1:40 am
Well, I would probably prefer a self-join over the existence check... EXISTS is rather self-explaining, while here you need comments to make sure other people will quickly understand your code......
April 20, 2005 at 2:26 am
Question is, can you guarantee, that every column will always have non-NULL value in one row with a given ID? The sample of data looks like that, but is it...
April 20, 2005 at 2:11 am
Well, if you just want to send an alert if the view returns something, why not use this as a condition:
IF EXISTS (SELECT * FROM [vwDups])
That is, if you don't...
April 20, 2005 at 1:39 am
IMHO you are asking for big trouble this way, sooner or later - probably rather soon.. If you are at it, you might as well make a table called Current_month and at the end...
April 19, 2005 at 1:37 am
Right, I overlooked in your original post, that the column contains both numbers AND letters. If it is always so that the first 3 characters are numbers and the fourth...
April 19, 2005 at 1:02 am
What the code does is, that it calculates remainder of division of the number by 2. If remainder = 0, then it takes the first character. If remainder is 1,...
April 18, 2005 at 8:03 am
joe,
please don't be confused by my joke at EU, what I said about David's code being nice was meant in earnest. It is the best solution, because it does the...
April 18, 2005 at 7:45 am
Wow, that with substring looks nice :-). You even managed to get something about European Union into it... is this following some new Euro-SQL directives from Brussels?
April 18, 2005 at 7:29 am
Viewing 15 posts - 1,006 through 1,020 (of 1,216 total)