Query to Get single row from a table

  • Recently in an Interview I was asked to write a Query with follwing Criteria

    1. There is a Table with name X which contains soem valid data.

    2. We don't know the column name in the  Table.

    The result set of the Query should return only one row.

    I tried with Top key word. but there is no use it's asking for colunm Name.

    I'm very much eager to know the Answer.

     

    Thanks in advance for taking time for replying to my post.

     

  • Hi,

    This should work.

     

    select top 1 * from x

  • Thanks for your Reply Veeresh. It's working fine

     

  • Any other interview questions... please....

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

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