Viewing 15 posts - 1,351 through 1,365 (of 10,144 total)
Often simply formatting a query nicely is sufficient to be able to figure out what's going on. The Simple Talk prettifier will get you most of the way there. I've...
August 1, 2016 at 8:41 am
SELECT mu.Id, mu.name, mu.Code,
Count(mu.Id) AS UnitCount
Into TN -- temporary table?
FROM Ref.MilitaryUnit mu
LEFT JOIN Person.DMDC dmdc ON mu.Id = dmdc.Id
LEFT JOIN Person.Military mp ON mu.Id = mp.UnitId
Group By mu.Id,...
August 1, 2016 at 8:21 am
Luis Cazares (8/1/2016)
UPDATE [MEMBER].[IMP_MEMBER_INT]
SET
[ContactLastName] = CASE WHEN...
August 1, 2016 at 7:43 am
Sean Lange (7/29/2016)
ChrisM@Work (7/29/2016)
Sean Lange (7/29/2016)
ChrisM@Work (7/29/2016)
Sean Lange (7/29/2016)
Good grief...the spammers are out in force today.Reported as spam
Sweet!!! Maybe I can get banned!?!?!?!?!
It's Friday, you can get anything you like...
July 29, 2016 at 9:54 am
Sean Lange (7/29/2016)
ChrisM@Work (7/29/2016)
Sean Lange (7/29/2016)
Good grief...the spammers are out in force today.Reported as spam
Sweet!!! Maybe I can get banned!?!?!?!?!
It's Friday, you can get anything you like 🙂
July 29, 2016 at 9:23 am
Sean Lange (7/29/2016)
Good grief...the spammers are out in force today.
Reported as spam
July 29, 2016 at 9:03 am
BigB (7/28/2016)
HiYeah I know how outer join works. Just wondering why it is not updating tab1.id when select returning the result set. Anyway, how can this be achieved then?
The select...
July 28, 2016 at 5:12 am
The answer to your question is "there are no qualifying rows in t1 to update". You're mistaking NULL as a placeholder for NULL as a value.
July 28, 2016 at 4:24 am
bhushanbagul (7/28/2016)
July 28, 2016 at 3:35 am
BrainDonor (7/28/2016)
How many people out there are going to think "I could do with a new kitchen, where should I look? I...
July 28, 2016 at 3:17 am
JoNTSQLSrv (7/28/2016)
Sergiy (7/28/2016)
Can you be more specific about the term "completely different logic"?Are the tables at least the same for those different logics?
Thanks for your reply Sergiy, i meant...
July 28, 2016 at 1:38 am
Like this:
SELECT ReturnValue
FROM (
SELECT
ReturnValue = ISNULL(cast(replace(left(QueryValue,charindex('|',QueryValue)-1),'{','') as float)/1000,0),
rn = ROW_NUMBER() OVER (PARTITION BY SourceID, PcsAssmntDataID ORDER BY IdentifierID DESC)
FROM livefdb.dbo.PcsAssmntData_Queries
WHERE SourceID = 'BRO'
and QuerySetID = 1
and QueryNumberID = 1
and PcsAssmntDataID...
July 27, 2016 at 7:07 am
NineIron (7/27/2016)
alter function dbo.fnWeight(@VisitID varchar(100))
RETURNS float as
BEGIN
DECLARE @Return float
set @VisitID=@VisitID + '{A^VS.WEIGHT}'
select @Return=cast(replace(left(PADQ.QueryValue,charindex('|',PADQ.QueryValue)-1),'{','') as float)/1000
from livefdb.dbo.PcsAssmntData_Queries PADQ
inner join (selectSourceID,
PcsAssmntDataID,
max(IdentifierID) as...
July 27, 2016 at 7:03 am
You don't need the wildcard on the left-hand side of the variable because you're matching from the left. It's also not SARGable (cannot exploit seeks). Try this instead:
where PcsAssmntDataID LIKE...
July 27, 2016 at 6:26 am
sanjayasamantaray (7/27/2016)
I have week codes like 201551 , 201552I want the sql query to return firstday and last day for those weeks
How are the weeks defined?
Is the first day...
July 27, 2016 at 6:22 am
Viewing 15 posts - 1,351 through 1,365 (of 10,144 total)