473,386 Members | 1,610 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,386 software developers and data experts.

Sorting database table values by various criteria

How can I sort some sports tables from database by mulitple criteria?
If two teams have the same point numbers i have to check for some
additional conditions...
Is this possiblein SQL QUERY string or do i have to do it in php?

how do i do it in either way?

thnx
Jul 17 '05 #1
4 1469
Goran Ljubej wrote:
How can I sort some sports tables from database by mulitple criteria?
If two teams have the same point numbers i have to check for some
additional conditions...
Is this possiblein SQL QUERY string or do i have to do it in php?

how do i do it in either way?

thnx


Try something along the line of:

SELECT col1, col2, ...
FROM mytable
WHERE cond1 AND cond2
ORDER BY cola, colx;

Jul 17 '05 #2
jerry gitomer wrote:
Goran Ljubej wrote:
How can I sort some sports tables from database by mulitple criteria?
If two teams have the same point numbers i have to check for some
additional conditions...
Is this possiblein SQL QUERY string or do i have to do it in php?

how do i do it in either way?

thnx

Try something along the line of:

SELECT col1, col2, ...
FROM mytable
WHERE cond1 AND cond2
ORDER BY cola, colx;

this order by... does that mean that it will first order by cola and
then if the same cola it'll order by colx???

if yes than it might be something i am looking for...
Jul 17 '05 #3
On Sat, 16 Apr 2005 15:38:19 +0200, Goran Ljubej <go**********@mail.inet.hr>
wrote:
jerry gitomer wrote:
Goran Ljubej wrote:
How can I sort some sports tables from database by mulitple criteria?
If two teams have the same point numbers i have to check for some
additional conditions...
Is this possiblein SQL QUERY string or do i have to do it in php?

how do i do it in either way?


Try something along the line of:

SELECT col1, col2, ...
FROM mytable
WHERE cond1 AND cond2
ORDER BY cola, colx;

this order by... does that mean that it will first order by cola and
then if the same cola it'll order by colx???

if yes than it might be something i am looking for...


What happened when you tried it? But the short answer is yes.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #4
Andy Hassall wrote:
On Sat, 16 Apr 2005 15:38:19 +0200, Goran Ljubej <go**********@mail.inet.hr>
wrote:

jerry gitomer wrote:

Goran Ljubej wrote:
How can I sort some sports tables from database by mulitple criteria?
If two teams have the same point numbers i have to check for some
additional conditions...
Is this possiblein SQL QUERY string or do i have to do it in php?

how do i do it in either way?

Try something along the line of:

SELECT col1, col2, ...
FROM mytable
WHERE cond1 AND cond2
ORDER BY cola, colx;


this order by... does that mean that it will first order by cola and
then if the same cola it'll order by colx???

if yes than it might be something i am looking for...

What happened when you tried it? But the short answer is yes.

thanks a lot... I havent tried it yet... I'm just thinking about how
would i do it... :)
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that...
17
by: Matt Kruse | last post by:
I'm looking for the best JS/CSS solution to add functionality to tables. The only browser which needs to be supported is IE5.5+, but no activeX can be used. to be able to do: - Fixed header row...
2
by: Tim Marshall | last post by:
Access 2003. The situation is this: I have a "criteria selection form" in which there are a many different criteria, mostly displayed as combo and text boxes in which a user can enter stuff,...
4
by: Mark Rae | last post by:
Hi, I'm writing a WinForms app in C# and need to store various items of lookup data which will be accessible and maintainable by the user. I'm looking for advice as to the best way to achieve...
29
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this...
9
by: Nenad Loncarevic | last post by:
I am a geologist, and over the years I've accumulated quite a number of proffesional papers on the subject, in various publications. I would like to make a database that would help me find the...
47
by: Jo | last post by:
Hi there, I'm Jo and it's the first time I've posted here. I'm in process of creating a database at work and have come a little unstuck.....I'm a bit of a novice and wondered if anyone could...
9
by: apattin | last post by:
HI all, Can someone explain this sorting issue? we are using V8 on Windows, but database *might* have been created with V7 (I can find out if it really matters) I have a table with one...
0
by: daverskully | last post by:
I REALLY REALLY appreciate any help that anyone can offer. I have a table called Data with the following fields: 1) ID 2) ReportDate 3) Department 4) DepartmentNumber 5) AccountExecutive...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.