Forum Replies Created

Viewing 15 posts - 8,566 through 8,580 (of 10,144 total)

  • RE: select top N records

    Hi Sandy

    You're missing the parentheses around the variable:

    select top (@n) * from emp_detail

    Cheers

    ChrisM

  • RE: How to insert into table based on previous results

    Yes, that's pretty much it. As you can see, you can do a whole set at a time, no fiddling about with single rows.

    What do you want to do with...

  • RE: Getting a sub-select query to work with 2 MAX(column)

    Jack Corbett (4/6/2009)


    I think?

    It's one of those, Jack, but the requirements are so ambiguous it's kinda hard to tell 🙂

  • RE: Getting a sub-select query to work with 2 MAX(column)

    JacekO (4/6/2009)


    Chris,

    I thought you were heading to a pub...:-P

    Nah Jacek, the kitchen! Leffe brune, just the one...gonna stop now, keep bumping into Jack. Good luck, Jack 😎

  • RE: How to insert into table based on previous results

    jbuttery (4/6/2009)


    I can't seem to figure how to insert new records into a database based on previous records. I want to read a record, increment or modify several columns and...

  • RE: Getting a sub-select query to work with 2 MAX(column)

    I reckon this is what you are looking for

    DROP TABLE #Temp

    CREATE TABLE #Temp (col1 CHAR(1), col2 CHAR(1), col3 CHAR(1), col4 CHAR(1), col5 CHAR(1))

    INSERT INTO #Temp (col1, col2, col3, col4, col5)

    SELECT...

  • RE: Multi Column Sort

    jsanborn (4/6/2009)


    I agree. I think an application solution would be best. It looks like any possible SQL solution is going to be very cumbersome. Thanks all.

    As they say here "it...

  • RE: Getting a sub-select query to work with 2 MAX(column)

    Jack Corbett (4/6/2009)


    Chris Morris (4/6/2009)


    Good Lord, sorry Jack, what was I thinking :blush: time for more coffee!

    No worries. I was just a little surprised you said that, and knew...

  • RE: Getting a sub-select query to work with 2 MAX(column)

    Jack Corbett (4/6/2009)


    Chris Morris (4/6/2009)


    Jack Corbett (4/6/2009)


    One problem with your first query is that it includes the columns you want the MAX for in the GROUP BY so you get...

  • RE: Getting a sub-select query to work with 2 MAX(column)

    Jack Corbett (4/6/2009)


    One problem with your first query is that it includes the columns you want the MAX for in the GROUP BY so you get all the rows. ...

  • RE: Multi Column Sort

    Bob Hovious (4/6/2009)


    This has certainly been an interesting problem to follow.

    Hey Bob, I'm still messing about with derivatives of this - have you got...

  • RE: Multi Column Sort

    Bob Hovious (4/6/2009)


    Sweet. This has certainly been an interesting problem to follow.

    Anyone heard from the OP lately?

    Nope. Bet he's busy with his nose...

  • RE: Multi Column Sort

    GSquared (4/6/2009)


    Chris, on the case-statement version, running on the same hardware as the prior tests, took 8:59 (nearly 9 minutes) the first run, 8:54 the second.

    If that was exactly as...

  • RE: error of sintax

    pedro.ribeiro (4/6/2009)


    Hi,

    Yap, there's other reason.

    With the result of the select i will trie to produce a txt file (script) that as insert statements.

    This script will be sent to other...

  • RE: Query Doubts

    pandeharsh (4/6/2009)


    SELECT Table1.code

    FROM Table1, Table2

    WHERE Table1.code not in(select code from Table2)

    GROUP BY Table1.code;

    I get the result,but i do not want to use group by or distinct clause.

    Can I acheive...

Viewing 15 posts - 8,566 through 8,580 (of 10,144 total)