Viewing 15 posts - 121 through 135 (of 683 total)
This works for me...
declare @stores table (stor_name varchar(10))
insert @stores
select 'Simon'
union all select 'Simon'
union all select 'Simon'
union all select 'Simon'
union all...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 8, 2008 at 5:17 am
simon.letts (5/8/2008)
There are 10 occurences of this store but I want it broken down into how it really is ie Simon 4, simon 3, SIMON 4
4 + 3 +...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 8, 2008 at 5:15 am
Mark (5/7/2008)
Jeff Marcus (5/7/2008)
If you are using SQL Server 2005 you can use ROW_NUMBER instead.
If you're not using SQL 2005, I guess you could simulate ROW_NUMBER like this...
declare @param varchar(8000)
set...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 7, 2008 at 10:27 am
David (5/7/2008)
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 7, 2008 at 6:34 am
shamshudheen (5/7/2008)
Jeff,
Who's Jeff?
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 7, 2008 at 4:53 am
Here's an article from the other day with some examples...
http://weblogs.sqlteam.com/jeffs/archive/2008/04/23/unpivot.aspx
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 7, 2008 at 4:50 am
Piotr Rodak (5/7/2008)
Look at the PIVOT command in BOL, this should do the job.Piotr
UNPIVOT or UNION ALL might be more useful 🙂
There are examples in BOL...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 7, 2008 at 4:44 am
mjschwenger (5/2/2008)
This is exactly what I was looking for.How can I incorporated into a SP that will return also the result set?
Thanks so much for the help,
Tom
Just like any other...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 7, 2008 at 1:51 am
Nice work, Jeff. That plural table name must've been difficult for you to come to terms with 😀
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 7, 2008 at 1:39 am
No matter. Something like this...
declare @tblcustomeraudit table (customerid int, forename varchar(20), surname varchar(20))
insert @tblcustomeraudit
select 1, 'John', 'Smith'
union all select 1,...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 2, 2008 at 4:32 am
Is there a primary key or unique row identifier for the table?
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 2, 2008 at 4:15 am
This all looks fine to me.
Are there any lines like the following which don't contain an aggregation (like COUNT)?
SET @Completed_Null_Urgency_INT = (SELECT COUNT(Order_Code) AS Count_INT
The error...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 2, 2008 at 4:05 am
icocks (5/2/2008)
can't be botheredIan
Laziness is the mother of invention :w00t:
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 2, 2008 at 3:57 am
I agree with Michael. This is the example I knocked up, but I was waiting for a reply. I also wanted to know if 'pairs' could have one of them...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 2, 2008 at 3:45 am
So what would be an example of the user inputs? Several pairs of product name and product type (potentially)?
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 2, 2008 at 2:24 am
Viewing 15 posts - 121 through 135 (of 683 total)