Viewing 15 posts - 766 through 780 (of 1,923 total)
How about this?
; WITH RecrusiveCTE AS
(
SELECT ID, FieldA , FieldB, fieldC , Int1 , Int1 AS RngTotal , 1 AS Ranker
FROM list_1
WHERE ID = 1
UNION ALL
SELECT OrigTable.ID , OrigTable.FieldA ,
...
May 19, 2011 at 7:54 pm
mikes84 (5/19/2011)
ColdCoffee,Anyway, the one piece I think it's missing is a line that has Joe, ST, CoveredByBase, then all nulls for security. Is there a way to incorporate that?
Yeah, i...
May 19, 2011 at 3:10 pm
Probably this?
declare @DateFrom as datetime
declare @DateTo as datetime
set @DateFrom = dateadd(week, datediff(week, 0, getdate()) - 1, -1) -- first day of previoius week
set @DateTo = dateadd(ms,-3,DATEADD(wk, DATEDIFF(wk,0,getdate()),...
May 19, 2011 at 1:17 pm
For the test data you provided, i get the same results... can u please run it again and check?
May 19, 2011 at 12:16 pm
Awesome way of asking a question, Mike 🙂 Thanks for that...
This might help you:
; WITH DistUserCnt AS
(
SELECT Department, COUNT(DISTINCT UserID) DistUsrCnt
FROM Permissions
GROUP BY Department
)
, BaseGrps AS
(
SELECT 'Base' UserID, Application...
May 19, 2011 at 11:41 am
Lynn Pettis (5/18/2011)
May 18, 2011 at 1:04 am
Something like this?
DECLARE @TableOfDatesAndTimes Table
(
Dates VARCHAR(8) ,
Times VARCHAR(4)
)
--== Populate with test data
--== this is what u missed in the post ; Please provide sample data
INSERT INTO...
May 17, 2011 at 3:24 pm
abhisheksrivastava85 (5/17/2011)
May 17, 2011 at 3:50 am
Try this:
declare @Mytable as table(
SrNO int identity(1,1),
skillwllfsh int,
skillvideo int,
skillchsi int,
skillchn int,
skillcdv int,
skillcco int,
skillrpts int
)
insert into @Mytable (skillwllfsh, skillvideo, skillchsi, skillchn, skillcdv, skillcco, skillrpts) values
(1, 1, 1, 1, 1, 1, 0),...
May 16, 2011 at 12:33 pm
Try this:
; WIHT CTE AS
(
SELECT RN = ROW_NUMBER() OVER ( PARTITION BY ReferenceNo , CODE ORDER BY Date DESC )
, *
FROM CTE ...
May 16, 2011 at 12:03 pm
Have u tried the other solutions posted?
May 16, 2011 at 11:25 am
Two ways i could think of:
METHOD 1
DECLARE @Table Table
(
COL1 INT,
COL2 INT,
COL3 INT,
COL4 INT
)
INSERT INTO @Table VALUES
(11, 12, 11,...
May 16, 2011 at 9:58 am
mister.magoo (5/15/2011)
order by abs(rownum-(total_count/2)) DESC,Value desc
This is exactly what i had in my mind 🙂 Nicely done, MM...
May 15, 2011 at 12:37 pm
Few questions here :
1. How big a table is yours ?
2. Do u have IDENTITY column or any "numbered" column that can uniquely find a row in your table ?
This...
May 15, 2011 at 12:06 pm
mnagasrikanth219 (5/10/2011)
How to check the servers in production/use?
By loggin in 😀
May 10, 2011 at 5:06 pm
Viewing 15 posts - 766 through 780 (of 1,923 total)