Viewing 15 posts - 811 through 825 (of 1,347 total)
Without an ORDER BY, you cannot guarantee anything about a SELECT TOP query.
Just because it seemed to happen a certain way every day for the last 2 years doesn't...
December 22, 2005 at 12:52 am
All of the code above is "joining" the data, the difference is just in the syntax.
Joining using the WHERE part is old-style SQL, using the INNER JOIN syntax in the...
December 21, 2005 at 4:42 pm
You only need to join to Trans once, and do conditional summing based on the type:
SELECT Account.Name,
Sum(Case Trans.Type When 'A' Then Trans.Amount Else 0 End) as Actual,
...
December 21, 2005 at 2:55 pm
sp_help reports the actual size of the column in bytes.
nvarchar is unicode, 2 bytes per character, therefore you can only store 50 characters in it, but the physical size of...
December 21, 2005 at 2:37 pm
>>Jan comes after Dec thats why I have 1/1/2005,1/2/2005 at last position.
So ? July comes after December too, yet you have July dates *before* December dates in your example.
December 21, 2005 at 2:32 pm
And I don't understand your "answer"
You gave us a table, containing dates the way you'd like them ordered. In that table,...
December 21, 2005 at 1:29 pm
>>I need the dates in order
Yes. But in what order ?
Why is January coming after December, if July & August are coming before December ?
December 21, 2005 at 1:13 pm
How about just accurately telling us the requirements, instead of presenting a table of data and playing a game of "go fish" while we all guess at what's actually required...
December 21, 2005 at 12:52 pm
They aren't in the information schema views. You'll need to query sysindexes, using 'Where IndID = 1' for clustered index.
December 20, 2005 at 2:52 pm
You need to "unpivot" table1, or bite the bullet and design the table in correct normalized form.
This is an unpivot query.
Select 'United' As Airline, united As SomeNumber
Union All
Select 'Delta' As...
December 20, 2005 at 9:57 am
There is an error in the SQL. Use the '%' operator for modulus:
SELECT TOP 7000 * FROM YourTable WHERE (ID % 10) = 1
December 19, 2005 at 1:44 pm
You need to "unpivot" the data. This can be done in T-SQL using a UNION ALL query that converts columns to rows.
eg:
SELECT Name, City, State, Email, 1 As ID, Q1...
December 19, 2005 at 1:41 pm
>>What could be wrong?
Which SQL did you try ? What do the Row ID's in your table start at ?
December 19, 2005 at 1:31 pm
>>I agree with Carl as it seems there would be identical rows in the resultset which doesn't make any sense to me.
No-one in the forum really knows, do they...
December 18, 2005 at 3:52 pm
LOL .. so I wasn't the only 1 having a slow Friday at work. I did some benchmarking too and came to the conclusion that ... I'd learned something new....
December 16, 2005 at 9:06 pm
Viewing 15 posts - 811 through 825 (of 1,347 total)