Forum Replies Created

Viewing 15 posts - 811 through 825 (of 1,347 total)

  • RE: Index hints and top operatror

    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...

  • RE: Problem Using Alias

    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...

  • RE: Problem Using Alias

    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,

     ...

  • RE: nvarchar column can take only half of it''''s size

    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...

  • RE: SELECT Help

    >>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.

     

  • RE: SELECT Help

    And I don't understand your "answer"

    You gave us a table, containing dates the way you'd like them ordered. In that table,...

  • RE: SELECT Help

    >>I need the dates in order

    Yes. But in what order ?

    Why is January coming after December, if July & August are coming before December ?

  • RE: SELECT Help

    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...

  • RE: clustered index in what information_schema?

    They aren't in the information schema views. You'll need to query sysindexes, using 'Where IndID = 1' for clustered index.

  • RE: Select query question

    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...

  • RE: selecting the every tenth record.

    There is an error in the SQL. Use the '%' operator for modulus:

    SELECT TOP 7000 * FROM YourTable WHERE (ID % 10) = 1

  • RE: Transposing Information

    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...

  • RE: selecting the every tenth record.

    >>What could be wrong?

    Which SQL did you try ? What do the Row ID's in your table start at ?

  • RE: Bad Join syntax?

    >>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...

  • RE: Is there a better way to ignore time portion of a smalldatetime field

    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....

Viewing 15 posts - 811 through 825 (of 1,347 total)