convert non ansi join

  • This may or may not be what you are looking for, but I have no test data with which to test it.

    SELECT

    *

    FROM

    #tmpTicketInfo INFO

    inner join dbo.tblVoucherDetails IDETAIL

    on (INFO.RegionID = IDETAIL.RegionID

    and INFO.TicketNumber = IDETAIL.VoucherNumber)

    inner join dbo.tblVoucherGroup PACKAGE

    on (INFO.RegionID = PACKAGE.RegionID

    and INFO.TicketNumber = PACKAGE.VoucherNumber

    and IDETAIL.RegionID = PACKAGE.RegionID

    and IDETAIL.VoucherNumber = PACKAGE.VoucherNumber

    and IDETAIL.PackageID = PACKAGE.GroupID)

    inner join dbo.tblUnit UNIT

    on (IDETAIL.UnitID = UNIT.UnitID)

    left outer join dbo.tblChargeType CHARGE

    on (IDETAIL.ChargeTypeID = CHARGE.ChargeTypeID

    and CHARGE.CompanyID = @CompanyID)

    WHERE

    UNIT.CompanyID = @CompanyID

    and IDETAIL.BidTypeID = 2

  • ritu.thatola (4/6/2010)


    Sorry to say this, instead of helping me you guys are writing......

    I am not a Database person.... Just trying to solve some problem and I hope that this forum would help me ....

    Anyway Thanks a lot to all of you who helped me.

    For the best help please take the time to read the first article I reference below in my signature block. if you follow the instructions in that article when posting questions you will get much better answers to your questions, plus you will get tested code in return.

    Just be sure to include the expected results based on your sample data as well, as that will give us something to check our results against.

  • ritu.thatola (4/6/2010)


    Sorry to say this, instead of helping me you guys are writing......

    I am not a Database person.... Just trying to solve some problem and I hope that this forum would help me ....

    Anyway Thanks a lot to all of you who helped me.

    You're welcome. But is the remaining problem?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 3 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply