Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

urgent sql help please

Options
  • 30-07-2010 11:00am
    #1
    Closed Accounts Posts: 1,759 ✭✭✭


    hi guys,
    hoping someone can sort me out here

    select a.id, b.id from tableB B
    inner join (select top 1 id from tableC
    where id = b.id) test on
    blah = blah

    getting the multi-part identifier could not be bound,
    how do I reference my b.id into the sub select query :-(

    thanks a lot


Comments

  • Registered Users Posts: 2,800 ✭✭✭voxpop


    I dont think you can use a join like that - should be something like below

    select a.id, b.id from tableB B
    inner join tableC c on c.id = b.id
    where x=y


    plus there is no "a" table for a.id


  • Hosted Moderators Posts: 3,807 ✭✭✭castie


    Aye best to join on that where clause instead.


Advertisement