Sub Query

  • Can we get more than 1 column from an subquery

  • if you select from a subquery. i think its the same thing anyway.

    select

    x.col1,

    x.col2

    from

    (select col1,col2 from table1)x

    there's no real need to have more than one column if its an "IN ()" structure.

  • You can have more than one columns IF the subquery is used in the FROM Clause.

    But NOT if used in Select List (column list), Where conditions and Having conditions. Only one column value can be returned.

    You can concatenate the values of two or more columns into one (if required...)

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

  • Thanx davidandrews13

    🙂

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

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