Viewing 15 posts - 286 through 300 (of 303 total)
sead.j (7/2/2008)
I can post DDL and sample data but isn't it easier way just to post Northwind MDF and LDF...
July 3, 2008 at 8:00 am
If you would post your DDL and some sample data, it would be easier for us to help you.
Create some temp tables and some insert statements with sample data.:)
See here...
July 2, 2008 at 8:56 pm
A comma is the same as a cross join.
It returns a cartesian product. 😉
Personally, I don't see how it is possible using a nested subquery.
If you do find an...
July 2, 2008 at 12:30 pm
Jeff Moden (6/26/2008)
is250sp (6/26/2008)
I am a visual person. Would you mind showing me examples of how I would incorporate this into the script above?
Ummm... sure... here's the original script...
June 27, 2008 at 7:49 am
The example I gave is a modified example of what we are doing.
I thought the actual example would take too long to explain.
Does anyone have any suggestions of how to...
June 26, 2008 at 1:22 pm
Take a look at this post: http://www.sqlservercentral.com/Forums/Topic519719-338-1.aspx
June 23, 2008 at 7:47 am
Since you are using SQL Server 2005 you can use a PIVOT.
declare @cust_product table
(cust varchar(10), prod varchar(10))
insert into @cust_product VALUES ('A','P')
insert into @cust_product VALUES ('A','Q')
insert into @cust_product VALUES ('A','P')
insert...
June 20, 2008 at 7:21 am
I've seen the same issue solved as follows:
You could have a table that stores a global unique id. Start it with a value of 1.
Create a stored procedure that returns...
June 19, 2008 at 10:06 am
Question: What's with all of the Left Join (Select * from #Report)
?
Is that any different than doing a join like this:
Select
SUM(ISNULL(R1.Users,0)) ...
June 18, 2008 at 11:55 am
How about this?
;WITH OrganizationUsers AS
(
SELECT U.Organization
,R.Users
,R.[Month]
,R.[Year]
FROM #Users U
JOIN #Report R ON U.UserAlias = R.UserAlias
)
SELECT [Year]
, [Month]
, [Org1]
, [Org2]
, [Org3]
FROM OrganizationUsers
PIVOT( SUM(Users) FOR Organization IN ([Org1], [Org2], [Org3])) AS OrganizationPivot
GROUP BY...
June 18, 2008 at 10:18 am
Can you please post your DDL and some sample data?
That will make it a lot easier to answer your question. 😉
June 18, 2008 at 9:05 am
Some more links that may be helpful:
http://aspadvice.com/blogs/jlovell/archive/2004/09/15/1992.aspx
June 3, 2008 at 9:05 am
balamurugan.ganesan (5/26/2008)
I need to load a csv file in to SQL 2005 which has comma within the data. How to load this I am fed up trying this:angry:
Some help on...
May 28, 2008 at 8:57 am
Matt, your example misses a row.
My example returns one row for each minute, yours misses one minute.
Your Results:
ActionTimeactionName
1900-01-01 12:40:51.000BUY
1900-01-01 12:41:41.000SELL
1900-01-01 12:42:01.000BUY
1900-01-01 12:42:41.000SELL
1900-01-01 12:42:51.000BUY
My Results:
ActionTimeActionName
01:42BUY
12:40BUY
12:41BUY
12:41SELL
12:42BUY
12:42SELL
May 15, 2008 at 9:21 am
How about this:
DECLARE @Actions TABLE
(
ActionTime DATETIME
,ActionName VARCHAR(10)
)
INSERT INTO @Actions
SELECT '12:40:01' ,'BUY' UNION ALL
SELECT '12:40:31' ,'BUY' UNION ALL
SELECT '12:40:51' ,'BUY' UNION...
May 15, 2008 at 8:42 am
Viewing 15 posts - 286 through 300 (of 303 total)