Viewing 15 posts - 331 through 345 (of 413 total)
I suppose you could define a cursor over "select distinct Type from table1", use this to build a string with the SQL statement you are after, and then dynamically execute this...
August 1, 2005 at 7:40 am
Could you post the definition of FloatToStr as well?
August 1, 2005 at 2:34 am
Alternatively, use the following:
select
user_id,
opdate,
sum(case when Type = 'HIV' then 1 else 0 end) as HIV_Count,
sum(case when Type = 'HBs' then 1 else 0 end) as HBS_Count
from table1
group by user_id, opdate
August 1, 2005 at 2:19 am
I am still not sure I understand you correctly, but as long as the outer transaction can be rolled back, I don't think you can avoid having a lock on...
August 1, 2005 at 2:06 am
Surely, there are many opinions on column names, and you shouldn't redesign a whole system based on what I think But I would...
July 29, 2005 at 3:09 am
Try
Select * from orders o left join [order details] od
on o.orderid = od.orderid
where od.orderid is null
July 29, 2005 at 1:21 am
Peet, thanks for providing a table definition and sample data that I can copy and paste into my query analyzer And thanks for...
July 29, 2005 at 1:18 am
I suppose the two tables have the same definition. You could of course execute "select * from ? order by ?", save results to files and make a file comparison.
You...
July 29, 2005 at 12:16 am
Thanks, VladRUS.ca... I am surprised that I am falling that much behind I thought David's solution was slow...
July 28, 2005 at 8:41 am
The negative amount only came up because I wanted to say that your query might produce a different output. As I said, this may not be the case, I don't...
July 28, 2005 at 8:31 am
You might be able to achieve what you want if you use save points. The code below may not be nice, but it can be used to begin, commit and...
July 28, 2005 at 7:40 am
Scott, Mark has stated that he wants 'OK' back. Furthermore, he has stated quite clearly what the condition on past due amounts should be. You may of course start a discussion of...
July 28, 2005 at 7:24 am
I suppose you are thinking of something like
CREATE TABLE #Numbers( Number varchar(100), sort varchar(1000) null, dot1 int null, dot2 int null)
INSERT INTO #Numbers (Number) VALUES( '1')
INSERT INTO #Numbers (Number)...
July 28, 2005 at 2:45 am
You certainly have some points there and your query is definitely simpler
I am not sure your query meets condition 2 of the original...
July 28, 2005 at 12:57 am
Very nice, I'm impressed - I will store this trick for later use
July 27, 2005 at 8:30 am
Viewing 15 posts - 331 through 345 (of 413 total)