Viewing 15 posts - 976 through 990 (of 1,439 total)
GilaMonster (12/7/2009)
Hmmm. Just got email from random SSC member. Starts "Help me with this" then goes on for 2 pages. Looked like homework too.Shift-Delete
Me too, seems to be this
http://www.sqlservercentral.com/Forums/Topic829828-338-1.aspx
Can't help...
December 7, 2009 at 8:24 am
SELECT OrderNumber
FROM OrderDetails
GROUP BY OrderNumber
HAVING COUNT(SINumber)=0
December 4, 2009 at 3:17 am
SELECT ID
FROM MyTable
GROUP BY ID
HAVING COUNT(DISTINCT CODE)>1
December 4, 2009 at 2:03 am
Faye Fouladi (12/3/2009)
Select IsNULL(Count(*), 0) As Count, RT.Report_ID, ReportName, ReportCategory From
tTracking_tblReportsUsage tbTracking
Right Join tblReportsNew RT On...
December 3, 2009 at 10:01 am
I suspect this would be more efficient with a numbers/tally table
declare @TargetStr varchar(8000),
@SearchedStr varchar(8000),
@Occurrence int
set @TargetStr='a'
set @SearchedStr='abbabba'
set @Occurrence=3;
WITH Occurrences AS (
SELECT Number,
...
December 2, 2009 at 5:05 am
GSquared (12/1/2009)
Mark, that will produce a count of 1 if there are zero rows in the outer join, if I'm not mistaken. Test it and see what you get.
The...
December 1, 2009 at 7:40 am
Without DDL and sample data, this is little more than a guess.
WITH NavigationHierarchy (menuItemId, parentId, displayName, linkUrl, sortOrder, treeLevel) AS
(
SELECT mi.menuItemId, mi.parentId, mi.displayName, mi.linkUrl,...
December 1, 2009 at 3:57 am
GSquared (11/30/2009)
Would look something like:
select DeptID, DeptName, GradeID, GradeName,
(select count(*)
from Employee
where DeptID = Department.DeptID
and GradeID...
November 30, 2009 at 10:25 am
Try this
SELECT s1.StartDate,
MIN(t1.EndDate) AS EndDate
FROM Overlapping s1
INNER JOIN Overlapping t1 ON s1.StartDate <= t1.EndDate
AND NOT EXISTS(SELECT * FROM...
November 30, 2009 at 3:24 am
See if this helps
DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
SET @StartDate='20100901'
SET @EndDate='20100921'
SELECT CASE WHEN FromDate>=@StartDate THEN FromDate ELSE @StartDate END AS StartDate,
CASE WHEN ToDate<=@EndDate THEN...
November 30, 2009 at 3:19 am
amazona (11/27/2009)
I find it strange that TSQL doesn't have built-in cross-tab query functionality whereas Access does....
November 27, 2009 at 7:08 am
Maybe this?
update cants
set first_priority = 1
from (select max(date) date, d.Id
from cants d
where ...
November 27, 2009 at 4:16 am
Lynn Pettis (8/4/2008)
November 27, 2009 at 3:21 am
Try this
WITH CTE AS (
SELECT TownName, CountyName,
COUNT(*) OVER(PARTITION BY TownName) AS cn
FROM Town
INNER JOIN County ON County.CountyID = Town.CountyID
)
SELECT TownName, CountyName
FROM CTE
WHERE cn>1
November 26, 2009 at 8:45 am
This will give you a list of all overlapping activities
SELECT a.actid,
b.actid AS Overlapped_actid
FROM @tActivities a
INNER JOIN @tActivities b ON b.actid>a.actid
AND a.astarttime<b.astoptime
...
November 26, 2009 at 8:18 am
Viewing 15 posts - 976 through 990 (of 1,439 total)