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

    Question Unanswered: ASE Problem Subquery

    Hi,

    I use ASE 12.5.0.2 and I want to do a subquery.
    I found the syntax.

    select city from (select city from publishers)
    and
    select city from (select city from publishers) cities

    When I launch it I've got the following message :
    [Error Code: 156, SQL State: ZZZZZ] Incorrect syntax near keyword 'select'

    Did anyone knows the right syntax

  2. #2
    Join Date
    Nov 2006
    Posts
    13
    select * from tablename where city in ( select city from publishers) .

  3. #3
    Join Date
    Jan 2007
    Posts
    16
    I want to do a subquery with two tables.

    Ex:
    select heure from
    (select heure1 as heure from tab1
    union
    select heure2 as heure from tab2)

    but this syntax doesn't work.

  4. #4
    Join Date
    Nov 2006
    Posts
    13
    Why you are not use only this syntax mentioned below?
    select heure1 as heure from tab1
    union
    select heure2 as heure from tab2

    please confirm.

  5. #5
    Join Date
    Jan 2007
    Posts
    16
    Because I want the max hour of the two columns

  6. #6
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Derived tables is only available with ASE 12.5.1 and later
    As a work around create a view on your query
    then select from the view

Posting Permissions

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