Main menu

Skip to primary content
Skip to secondary content
  • Home
  • Downloads
  • Artworks

Archives

Recent Posts

  • Good evening h00mans…
  • Ai texas translation and more wtf
  • Get something in the mail
  • Not dead: Number Five is Alive
  • Ipso facto I passed
  • Argh philosophy
  • Up-grade
  • Beyond thought: liked, but…
  • Programming something…
  • Route 66: Oklahoma to Texas

Categories

  • Farmland chronicles
  • h00min resources
  • ITainment
  • Japanese Music
  • Japanese TV
  • Johnny's Jimusho
  • Korean music (kpop)
  • Korean TV
  • Music
  • Psychology
  • Solstice Productions
  • Tomohisa Yamashita
  • Webdesign

Recent Comments

  • Manu chan on Ai texas translation and more wtf
  • Manu chan on Ai texas translation and more wtf
  • Feles on Ai texas translation and more wtf
  • SnowMyth on Ai texas translation and more wtf
  • Feles on Get something in the mail

Post navigation

← Previous Next →

LEFT JOIN, RIGHT JOIN

May
10
2009

I’ve noticed a very interesting difference between my local development environment and my actual webhosting. In the master post this is the query that displays the artists available (if they have downloads). On my local development environment all the artists keep coming up, while on my webhosting only those with downloads show up (as they should). If I change LEFT JOIN to RIGHT JOIN I reverse the problem. lol.

  1. SELECT ar_artist_id, ar_artist, ar_image, COUNT(vi_artist_id) AS ar_numvideo
  2. FROM (artist INNER JOIN videos ON artist.ar_artist_id = videos.vi_artist_id) LEFT JOIN videodownloads ON videos.vi_video_id = videodownloads.vd_video_id
  3. WHERE artist.ar_pubterm <> ‘Actor’ OR ‘Actress’
  4.                  GROUP BY ar_artist_id
  5.                  ORDER BY ar_artist

It’s the same with this query that shows the downloads per artist on the artist page.

  1. SELECT artist.ar_artist_id, videotypes.vt_videotype, videotypes.vt_videotype_id
  2. FROM artist INNER JOIN (videotypes INNER JOIN videos ON videotypes.vt_videotype_id = videos.vi_videotype_id) ON artist.ar_artist_id = videos.vi_artist_id LEFT JOIN videodownloads ON videos.vi_video_id = videodownloads.vd_video_id
  3. GROUP BY artist.ar_artist_id, videotypes.vt_videotype, videotypes.vt_videotype_id
  4. HAVING (((artist.ar_artist_id)=$artistId))

What the hell? I have no explanation. haha.

This entry was posted in Webdesign and tagged master post, programming, sql. Bookmark the permalink.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:grin: :sad: :eek: :confused: :angry: :mad: :P :cry: :evil: :grr: :hoping: :smug: :bawl: :genki: :love: :hearteyes: :huh: :pissedoff: :ill: :mwahaha: :sweatdrop: :kickass: :drool: :wow: :wub: :sleepy: :unsure: :usuck: :victory: :innocent: :yippee: :hoi: :roflmao: :worship: :spank: :puke: :voyeur: :twitch: :fuming: :smokin: :omg: :food:

RSS Recent tracks

  • Dagoba – The Man You´re Not
  • FVT98 – Blind
  • Megadeth – Mechanix
  • Deathstars – The Rape
  • Mors Principium Est – Eternity's child
  

© 2011/ 2012 - Code Silence