Viewing 14 posts - 1 through 14 (of 14 total)
I am reading wrong? Looks like both count columns should have the same info?
Also the trick with CASE and any aggregate is to "reverse them" >>
SELECT SUM(CASE WHEN ConditionHERE =...
May 3, 2011 at 8:19 am
I am trying to do the following, but getting syntax errors:
SET @sql = 'Select*
frommyTable T
Where(T.code in ('+ @code +') or isnull( ('+@code +') ,0 )=0
and T.key...
May 13, 2009 at 2:33 pm
OK, this returns me a table of integers. How can I use my in clause with a table?
May 13, 2009 at 9:17 am
@path is not null! I pass a value to @path. I have tested it. The value is passed.
procedure....
@path
..
begin
insert into mytable ([[Path])
values ( @path + '_' + cast (scope_identity() as varchar(10))...
February 13, 2009 at 10:47 am
No, I was just leaving it out, because it didn't make any difference. Wouldn't it be pointless to write a query without a from clause?!
December 22, 2008 at 2:31 pm
select cast (Table.column1 as char(10)) + ' -- ' + cast (Table.column2 as char(10)) as newColumn
from Table
....
December 22, 2008 at 11:49 am
thanks for all the help. I don't know what i was doing wrong. It is just working now!
December 22, 2008 at 8:26 am
Yes, I do. I just want the last date or the first date. But in this case, let's go with the last date.
October 15, 2008 at 8:01 am
Thanks, sorry man bad. I should have mentioned that each record has a unique key, and this doesn't work.
DATA:
unique key product Id ...
October 15, 2008 at 7:33 am
DATA:
product Id Product Name purchase DATE
11111 ...
October 14, 2008 at 2:53 pm
No, that wouldn't work. I am returning a table, and only some rows in this table might have multiple records, from which i need to select the most recent one.
I...
October 14, 2008 at 2:45 pm
Viewing 14 posts - 1 through 14 (of 14 total)