Created
January 25, 2009 05:34
-
-
Save ocharles/51702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following executes only 1 SQL statement, and prints the names of all the releases (in my test data example - 2) | |
# that Massive Attack had artist credit for. | |
# SELECT me.id, me.name, me.gid, me.modpending, me.quality, me.modpending_qual, me.modpending_lang, me.artist, me.attributes, me.language, me.script, | |
# name.id, name.page, name.name, name.refcount FROM album me JOIN artist_credit artist ON ( artist.id = me.artist ) LEFT JOIN artist_credit_name | |
# names ON ( names.artist_credit = artist.id ) JOIN release_name name ON ( name.id = me.name ) WHERE ( names.artist = ? ): '1101' | |
for ($schema->resultset('Release')->by_artist($massive_attack)) { | |
diag("\t Release: " . $_->name->name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment