Viewing 15 posts - 916 through 930 (of 1,923 total)
lee rite (3/3/2011)
lee rite (3/3/2011)
ColdCoffee (3/3/2011)
SELECT GUIDFROM #T
GROUP BY GUID
HAVING COUNT( DISTINCT CompanyName) = 1
Thanks ColdCoffee! I think you nailed it. Your query selects all companies that never...
March 3, 2011 at 1:07 pm
SELECT GUID
FROM #T
GROUP BY GUID
HAVING COUNT( DISTINCT CompanyName) = 1
March 3, 2011 at 12:55 pm
lee rite (3/3/2011)
Craig Farrell (3/3/2011)
lee rite (3/3/2011)
Let me explain exactly what I'm working with, so you will see...
March 3, 2011 at 12:48 pm
Try this:
SELECT ID
FROM
( SELECT * FROM #T ) PIVOT_TABLE
UNPIVOT
(
Vals FOR ColNames IN ([2008],[2009],[2010])
) PIVOT_HANDLE
GROUP BY ID
HAVING COUNT(...
March 3, 2011 at 12:42 pm
Makes sense :-); how many rows are there in the table ?
March 3, 2011 at 12:30 pm
This:
DECLARE @startDT DATETIME,
@endDT DATETIME
SELECT @startDT = 'Feb 1 2011 12:00AM',
...
March 3, 2011 at 12:19 pm
NOthing, actualy 😛 two ways of writing it 🙂
March 3, 2011 at 11:55 am
Yes it will.. IF u could post sample data in a readily consumable foramt, we can work right away in providing a code for you..
March 3, 2011 at 8:11 am
Another one to the box:
select d.EmpNO ,
stuff( cast( (
select ','+ cast(...
March 3, 2011 at 7:53 am
Else:
SELECT distinct E.EmpNO,Y.Years As 'Missing Years' --E.EmpNo , Y.Years , d.EmpNO as 'DEmp', d.RYear
FROM demo E
CROSS JOIN
...
March 3, 2011 at 1:45 am
Try this:
; WITH DistinctEmpNos (EmpNo) AS
(
SELECT DISTINCT EmpNo
FROM demo
),
YearsAndEmps AS
(
SELECT E.EmpNo , Y.Years
FROM DistinctEmpNos E
...
March 3, 2011 at 12:42 am
riyaz.mohammed (3/1/2011)
ColdCoffee (3/1/2011)
select *
from orders outer_table
where itemid = '1063'
and not exists ( select 1 from orders inner_table
...
March 2, 2011 at 9:08 am
varunkum (3/1/2011)
Q1. I have a row with all zero's and another row with all nulls(empty). How do i hide them both ?
Select * from table
where isnull ( (c1 +...
March 1, 2011 at 12:20 pm
Craig Farrell (3/1/2011)
A question, how did you decide you only wanted 2 and 4? 1 also has a 1063, but has additional items, so in theory you could display...
March 1, 2011 at 12:11 pm
Try this:
select *
from orders outer_table
where itemid = '1063'
and not exists ( select 1 from orders inner_table
...
March 1, 2011 at 11:57 am
Viewing 15 posts - 916 through 930 (of 1,923 total)