David Krings wrote:
I'm getting back the rows that I want, but not in the correct order and only by using DISTINCT, which I once was told is a nono and not needed if I'd just do it right. My attempt to output the columns that contain the values the reocrds are to get sorted on ends up in being a cartesian join, which barfs up 1248 rows instead of the 26 I epxect.

Without seeing the actual SQL query it's impossible to guess where the problem is. In general though, cartesian joins are the result of incomplete join conditionals and, sometimes, overly-complex WHERE clauses in cases where a left join or sub-select would be more reliable.

The classic cartesian join:

SELECT * FROM users, orders;
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to