Getting always same 2 rows in first results.

  • Hi

    I want to select always two rows from our tables as first results besides the results that I get from my search.Sample Output I want to have like :

    Row Lang PubId Title

    1 en 4ed975f8 dddddd

    2 fr 70066abc 10.15.2009

    3 sr ba738703 bentley

    4 se ccccccc test test

    5 de bbbbbbb yami

    Any Ideas please help me.

    Thanks

  • So you want two rows to be returned and have them as the first two rows in the result set regardless of if they match your search criteria.

    or

    do you want two specific rows to return as the top results if they are part of the result set?

  • To guarentee some rows as first, you'll need a query to get just those two rows and then union that with your query to get other rows.

    Your sample data doesn't really explain what you want.

  • Hi you2

    Thanks for your replies. My search results have those two records but since I do order by creation date they may appear some where in last pages, I want to display them as the first two results.

  • Then the union mentioned above is the way to go

Viewing 5 posts - 1 through 5 (of 5 total)

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