Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2007
    Posts
    16

    Question Unanswered: Where with a select

    Hi,

    I use ASE 12.5.0.2

    I need to do a select with a another select in condition.
    Like this :

    select * from TabA where name=(select name from TabB)
    I need to get the select all the name of TabB, not just one.

    When I launch it, I've got :
    "a subquery returned several values. This is illegal when the subquery is preceded by =, !=, <, <= , >, >=, or used as an expression.

    If someone has an idea.
    thks.

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    You can change the "=" to "in"
    But will probably get better performance with a "where exists"
    i.e.
    select * from TabA where exists
    (select 1 from TabB where TabB.name=TabA.name)

  3. #3
    Join Date
    Jan 2007
    Posts
    16
    Thks pdreyer.
    It works !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •