Viewing 15 posts - 1,966 through 1,980 (of 2,171 total)
You mean like this? No need to change existing selects, just add one more select before the others.
CREATE PROCEDURE SP_news_date
(
@news_date datetime
)
AS
SELECT @news_date...
July 10, 2006 at 6:15 am
Yes, but you changed the testdata in this topic too...
This was the original test data in this topic.
A B C
1, 1, 1
1, 1, 1
1, 1, 1
2, 2, 2
2,...
July 9, 2006 at 7:49 pm
Sergiy, try to run your code against this test data...
declare @tableA table (a int, b VARCHAR(3), c VARCHAR(4))
insert @tableA
select 1, 'DD', '5' union all
select 1,...
July 9, 2006 at 7:43 pm
Or this one for handling ties.
-- Prepare test data
--
-- Demonstration only. Not needed in your environment.
--
declare @tableA table (a int, b VARCHAR(3), c VARCHAR(4))
insert @tableA
select 1,...
July 9, 2006 at 7:15 pm
-- Prepare test data
--
-- Demonstration only. Not needed in your environment.
--
declare @tableA table (a int, b VARCHAR(3), c VARCHAR(4))
insert @tableA
select 1, 'DD', '5' union all
select...
July 9, 2006 at 6:59 pm
Why did you change the question?
It is better you start a new topic so other can learn from this too...
July 9, 2006 at 5:20 pm
SELECT D.ProjectID,
H.AttResult ATTResult,
H.CallDateTime CallDateTime,
H.CRC CRC,
D.PhoneNum,
H.ProjName ProjectName,
H.ConnectTime ConnectTime,
D.SourceID,
D.Field1
FROM Dial D
INNER JOIN (
SELECT DialID,
MAX(CallDateTime) maxDT
FROM History
) z ON z.DialID...
July 9, 2006 at 4:25 pm
Sorry, my bad!
The WHERE and the LEFT JOIN should switch places.
SELECT D.ProjectID,
MAX(H.AttResult) ATTResult,
MAX(H.CallDateTime) CallDateTime,
MAX(H.CRC) CRC,
D.PhoneNum,
MAX(H.ProjName) ProjectName,
MAX(H.ConnectTime) ConnectTime,
D.SourceID,
D.Field1
FROM Dial D
LEFT JOIN History H...
July 9, 2006 at 2:55 pm
What you wrote in last post is not even proper syntax.
And why would you try to query Oracle for a constant string when...
July 9, 2006 at 2:36 pm
If there are more than 100 items within a group, then just add appriopiate code. Also, if there is substantially less than 100 items in a group, just delete not...
July 9, 2006 at 2:27 pm
You must set an alias after the paranthesis, like this
SELECT D.ProjectID,
(SELECT TOP 1 AttResult as ATTResult FROM History H
WHERE H.DialID = D.DialID AND H.PhoneNum = D.PhoneNum ORDER BY...
July 9, 2006 at 1:07 pm
Maybe it is some kind of corporate publication system, where web publisher uploads new articles for next week on the friday before. That could be new employees, foreign visits, legal...
July 8, 2006 at 12:57 pm
and en_date <= @news_date order by en_date DESC
July 8, 2006 at 3:40 am
I don't think it is the database that is the bottleneck of this. Transferring 1.6 million rows to the webpage is!
If these rows are all combinations of distances, you have only...
July 7, 2006 at 7:24 am
Viewing 15 posts - 1,966 through 1,980 (of 2,171 total)