October 16, 2009 at 6:09 am
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
October 16, 2009 at 8:56 am
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?
October 16, 2009 at 9:05 am
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.
October 16, 2009 at 9:11 am
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.
October 16, 2009 at 9:13 am
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