Re: Sorting table columns dynamically on normalized MySQL tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I can do that, but is there a better way? How do you all handle
> dynamic sorting of normalized DBs?

Firstly, what DB are you using?
Secondly, just select and sort on the columns.  An example query
would be:

SELECT
  course.name,
  location.name,
  instructor.name
FROM
  course
INNER JOIN location ON location.id = course.locationID
INNER JOIN instructor ON instructor.id = course.instroctorID
ORDER BY instructor.name

(or location.name or course.name).

It should be as simple as that...

thnx,
Chris

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux