Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)

  • Reply To: EXCEPT

    I ran the query and see zero rows only, please verify your answer.

  • RE: How to insert a value based on a sub query?

    You can write the insert statement like

    INSERT INTO myTable1([Col1], [Col2])

    SELECT [Col1], [Col2]

    FROM myTable2

    WHERE [Col1] IN (SELECT MAX([Col1] FROM myTable2)

    Does this solves your need.

  • RE: SELECT DISTINCT TOP 1

    You can use Group By clause and Aggregate functions to solve these duplicates.

    Try this

    SELECTA.acct_num, A.record_type, A.trade_nbr, A.market, A.secy_type, A.capacity

    FROM #trades A,

    (

    SELECT acct_num, record_type, MAX(trade_nbr)...

  • RE: Transaction inside Cursors

    Just try this out and lemme know it worked r not...

    DECLARE CURSOR FOR

    SELECT STATEMENET

    OPEN Cursorname

    FETCH NEXT FROM Cursorname INTO Variables

    WHILE (@@FETCH_STATUS=0 )

    BEGIN

    BEGIN TRAN

    ...

Viewing 4 posts - 1 through 4 (of 4 total)