Viewing 15 posts - 736 through 750 (of 1,923 total)
something like:
select pmd.psp_item_no,pmd.psp_item_var,sum(psp_qty_prpnl) as Total
from pmddb..pmd_mpsp_ps_postn pmd
--== added freshly
...
June 9, 2011 at 3:00 pm
calvo (6/9/2011)
I believe the logic is, if there is one and only one entity for the RU, then show it. (adhering to your...
June 9, 2011 at 12:45 pm
How abt this:
select CartesisRU
from #Cartesis_to_hfm
group by CartesisRU
HAVING MAX(HFMEntity) = MIN(HFMEntity)
June 9, 2011 at 11:54 am
How abt this?
; with allServicesRenderedCustomers As
(
select c.CustomerName
from #Customer c
group by
c.CustomerName
HAVING AVG ( CAST( c.Rendered as decimal(4,2))) = 1.00
)
select *
from #Customer c
join allServicesRenderedCustomers a
...
June 9, 2011 at 2:23 am
I dont get clearly what u mean by another table. can u describe more ? Sample table(s), some sample data and expected result, to start with??
June 9, 2011 at 1:02 am
An AND clause to the WHERE clause, may be??
Like, WHERE Description = 'Optional' ??
June 9, 2011 at 12:31 am
If the date will always an ascending order, then this will also help:
SELECT OuterTable.DateValues , OuterTable.IDs ,
[Effective Start] = OuterTable.DateValues ,
...
June 6, 2011 at 2:00 am
This MAY NOT be the best code or the best-performant one, but this cuts the deal.
Sample data ( for anyone who is interested in solving this problem)
SET NOCOUNT ON
--= This...
June 6, 2011 at 1:48 am
Look at UNPIVOT in Books Online ( a free help that comes with SQL Server). Online link to UNPIVOT - http://msdn.microsoft.com/en-us/library/ms177410.aspx
June 6, 2011 at 1:23 am
This problem is hard to solve unless we have another ID column which defines an unique row number per row; like an identity column. Without order of rows, the results...
June 6, 2011 at 1:22 am
Try this:
SELECT LEFT( WkstationID, 3 ) WkstationID , COUNT(*) COUNTS
FROM Workstation
GROUP BY LEFT( WkstationID, 3 )
June 5, 2011 at 10:49 pm
try this:
DECLARE @Table TABLE
( Value CHAR(2))
INSERT INTO @Table VALUES
('1d'),
('1y'),
('2d'),
('3d'),
('2w'),
('3y'),
('2m'),
('3m')
SELECT Value
FROM @Table
ORDER BY RIGHT(Value,1) ,CAST ( LEFT(Value,1) AS INT)
{Edit: Edited the code as per the expected result}
June 2, 2011 at 12:40 am
June 1, 2011 at 2:51 pm
Lowell (5/27/2011)
ColdCoffee (5/27/2011)
May 27, 2011 at 9:42 am
Viewing 15 posts - 736 through 750 (of 1,923 total)