Ass Hat
Home
News
Events
Bands
Labels
Venues
Pics
MP3s
Radio Show
Reviews
Releases
Buy$tuff
Forum
  Classifieds
  News
  Localband
  Shows
  Show Pics
  Polls
  
  OT Threads
  Other News
  Movies
  VideoGames
  Videos
  TV
  Sports
  Gear
  /r/
  Food
  
  New Thread
  New Poll
Miscellaneous
Links
E-mail
Search
End Ass Hat
login

New site? Maybe some day.
Posting Anonymously login: [Forgotten Password]
returntothepit >> discuss >> anyone good at SQL? by the_reverend on Feb 7,2006 11:05am
Add To All Your Pages!
toggletoggle post by the_reverend   at Feb 7,2006 11:05am
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



toggletoggle post by niccolai   at Feb 7,2006 11:34am edited Feb 7,2006 11:38am
try posting it on the dynamic drive forum.

There aren't many, but a couple guys there are really good with mysql/sql.

dynamicdrive.com/forums



toggletoggle post by anonymous at Feb 7,2006 12:24pm
that movie sucked



Enter a Quick Response (advanced response>>)
Username: (enter in a fake name if you want, login, or new user)SPAM Filter: re-type this (values are 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, or F)
Message:  b i u  add: url  image  video(?)show icons
remember:Soulless Necromonic Rapture
[default homepage] [print][10:44:16am Mar 28,2024
load time 0.01343 secs/15 queries]
[search][refresh page]