I don't know if this can be done without PLC or something like SPC
I posted this on another forum...
ok, this has been bugging me for a while.
I have 2 tables.
picturetable {index, bandname varchar, path...}
bandtable {index bandname varchar, displayname varchar, bandinfo...}
here is the deal that makes it tricky... there are bandnames in the picturetable that aren't in the bandtable and there are bandnames in the bandtable that arent in the picturetable.
what I am currently doing is:
SELECT pt.bandname as band, bandtable.bandname as btband, bandtable.displayname, bandtable.displayname FROM bandtable RIGHT JOIN (SELECT band FROM \'picturetable\' GROUP BY \'bandname\' ORDER BY \'bandname\') pt on pt.bandname=bandtable.bandname ORDER BY pt.bandname
this shows all the distinct bandnames in the picturetable joined to the bandtable and sorted by bandname.
what I want to do is this PLUS all the bandtable that aren't in the picturetable AND if that weren't enough... I want it sorted by the bandtable.displayname, but if that is null or blank, then order it by pt.bandname.
any for a 3rd part, I would like to cache the query until the number of rows in bandtable or the number of rows in picturetable change.
anyone? I know that's a lot to ask for...
http://www.php-editors.com/forum/index.php...dfca36e7dc71af04&act=ST&f=23&t=2008
http://forums.devshed.com/mysql-help-4/how...ing-and-sort-two-tables-324306.html