473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem in Sorting two resultset..

I ave a problem in sorting two resultset..
Supoose we have a follwing field in database..

Expand|Select|Wrap|Line Numbers
  1. id name vote type
  2.  
  3. 1  ashish  2   1
  4. 2  ashish  4   2
  5.  
i want to select top 5 records(according to vote) of type 1 and top voted 5 records of type 2 ....
then want to show on page these 10 records on sorting order according to vote ..

any suggestion ??

Please help me...

Thanks
Ashish...
Oct 8 '07 #1
2 1143
Connect to your database with php, enter and parse the correct queries, and display the results in a webpage.
Oct 8 '07 #2
Atli
5,058 Expert 4TB
Hi Ashish. Welcome to The Scripts!

Have you made any attempts at this yourself?
Can we see your code?

You will have to build a query to fetch those records from the database. How that is done depends on what type of SQL server you are using. (MySQL, MSSQL, Postgree, etc...)

You will also have to create a script to execute that query on you database and display the results. Again, how you can accomplish this depends on what type of SQL server you use.
Oct 8 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Savas Ates | last post by:
I have a stored procedure below.. When I run it with a well parameter in query analyser 3 of select statements return me. (i named select statements 1,2,3) But in asp page when i call this...
1
by: Tomislav Stilinović | last post by:
Hi all. I have a problem with collation in SQLServer database. My table contains few rows in field of type char(20), field and server Collation is set to Croatian_CI_AS (Windows collation). When...
2
by: Someone | last post by:
Using C#, ASP.NET I'm trying to implement Yahoo search API. I can sent the HTTP request and get back the results. The problem I have is that I don't know how to use XPath with the results than...
2
by: Neeraj | last post by:
Hii , We have DB2 7.1 on windows and we are trying to use a type 4 driver to connect to the data base . I have included the db2jcc.jar in the class path . I am able to create a connection to...
5
by: LDD | last post by:
Hi Folks I'm trying to determine a way to handle paging, filtering and sorting in a datagrid. If I choose to filter and sort, I'd like to return a subset. If that resultset has more records...
4
by: comp.lang.php | last post by:
'll try to explain this as clearly as possible, sorry if it's unclear. You have in your directory /foo 42 images You have in your database metadata for 30 out of those 42 images You have to...
10
by: sssk28 | last post by:
i have installed fedora core 6 and i am getting following error: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this...
1
by: John A Grandy | last post by:
In regard to a GridView that must support searching, filtering, sorting, and paging ... There is a tradeoff in performing the sorting and paging in the database versus to creating a CLR sort...
9
dmjpro
by: dmjpro | last post by:
I thought that when the connection gets closed then all resources get closed . I also included the ResultSet and Statement ;) . But if the Statement closed then only ResultSet closed. But now i got...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.