so I do "SELECT (album.name) FROM album INNER JOIN collection_info ON (collection_has_release_join.collection_info = album.id) INNER JOIN collection_info ON (collection_has_release_join.collection_info = collection_info.id)"
2008-06-26 17805, 2008
niklas_
error.log for apache-perl reads "[error] DBD::Pg::st execute failed: ERROR: missing FROM-clause entry for table "collection_has_release_join" at character 107 at /home/mbserver/svn/mb_server/cgi-bin/Sql.pm line 501.\n"
2008-06-26 17810, 2008
niklas_
and I have no idea why :(
2008-06-26 17839, 2008
warp
niklas_: eh? shouldn't the first 'collection_info' be 'collection_has_release_join' ?
2008-06-26 17810, 2008
niklas_
warp: in collection_has_release_join.collection_info = album.id?
2008-06-26 17840, 2008
warp
niklas_: SELECT <column> FROM <table> JOIN <table>, you have JOIN <column>
2008-06-26 17815, 2008
warp
i'm not _that_ good with SQL, so maybe i'm missing something.
2008-06-26 17849, 2008
niklas_
hmm perhaps its me who dont understand what you mean, but you arent confusing the attribute collection_has_release_join.collection_info with the table collection_info?
2008-06-26 17832, 2008
warp
ah, if there is a table 'collection_info', then yes.. i'm wrong.
2008-06-26 17842, 2008
luks
that query doesn't really make sense to me
2008-06-26 17846, 2008
warp
but still.. the tables mentioned in the ON clause should be in the FROM or JOIN.
perhaps you mean SELECT album.name FROM album INNER JOIN collection_has_release_join b ON b.album = album.id INNER JOIN collection_info ON c.id = b.collection_info?
2008-06-26 17856, 2008
luks
which still doesn't make much sense to me, but looks more correct :)
2008-06-26 17822, 2008
Muz
luks, missing an AS tehre aren't you?
2008-06-26 17835, 2008
Muz
INNER JOIN collection_has_release_join b ON b.album should be INNER JOIN collection_has_release_join AS b ON b.album, no?
2008-06-26 17843, 2008
luks
I don't think it's neccesary
2008-06-26 17812, 2008
Muz
And, collection_info ON c.id as collection_info AS c ON c.id?
2008-06-26 17816, 2008
luks
you only need it for column aliases
2008-06-26 17824, 2008
luks
not for tables
2008-06-26 17832, 2008
Muz
Hmmm, okay, I'll take your word for it. My brain is dead at the moment heh
2008-06-26 17846, 2008
luks
niklas_: guess it would be better to ask, what are you trying to select?
2008-06-26 17819, 2008
luks
because the query really looks useless as it is
2008-06-26 17800, 2008
sonium joined the channel
2008-06-26 17830, 2008
niklas_
oh
2008-06-26 17847, 2008
niklas_
I think Im confusing which table to join on
2008-06-26 17853, 2008
niklas_
INNER JOIN <what>
2008-06-26 17854, 2008
niklas_
Im trying to select all releases in a collection. so I want to join album.id with collection_has_release_join.album and collection_info.id with collection_has_release_join.collection_info
2008-06-26 17837, 2008
luks
I'd generally go for it from the other side
2008-06-26 17857, 2008
luks
or use subqueries if you want to select directly from album
2008-06-26 17844, 2008
niklas_
I'd feel more confident with using subqueries, but isnt that nasty?
2008-06-26 17853, 2008
luks
why?
2008-06-26 17809, 2008
niklas_
I dont know why it would be
2008-06-26 17810, 2008
luks
SELECT name FROM album WHERE id IN (...) seems fine to me
2008-06-26 17833, 2008
niklas_
ok cool
2008-06-26 17837, 2008
niklas_
thank you guys
2008-06-26 17820, 2008
Muz
It's not necessarily more nasty, it's just a different way to grab the desired results. There's often several ways to do things via SQL or any programming language for that matter :)
2008-06-26 17843, 2008
Wizzcat
subqueries are less optimized than joins
2008-06-26 17851, 2008
Wizzcat
they're also easier to screw up
2008-06-26 17839, 2008
luks
blah blah, ignore him :)
2008-06-26 17850, 2008
luks
Wizzcat should run EXPLAIN ... more often
2008-06-26 17857, 2008
Muz
First thing's first, get it working. FRom there you can work on optimizing it via checking EXPLAIN
2008-06-26 17859, 2008
Muz
Heh luks
2008-06-26 17800, 2008
luks
subqueries are always translatable to joins, and postgresql is not that stupid to not know how to do that
2008-06-26 17815, 2008
luks
it must be really complex query to confuse it
2008-06-26 17816, 2008
Wizzcat
I usually use mysql luks
2008-06-26 17823, 2008
Muzzz_
MySQAIDS.
2008-06-26 17824, 2008
luks
well, there's your problem :)
2008-06-26 17828, 2008
Wizzcat
anything that isn't bog standard works terribly
2008-06-26 17830, 2008
Wizzcat
I know
2008-06-26 17841, 2008
Wizzcat
I hate the world for using mysql so I have to support it
2008-06-26 17805, 2008
Muz
Curses, ruaok isn't about
2008-06-26 17806, 2008
nxmehta has quit
2008-06-26 17811, 2008
pbryan has quit
2008-06-26 17851, 2008
tolsen joined the channel
2008-06-26 17817, 2008
pbryan joined the channel
2008-06-26 17855, 2008
ruaok joined the channel
2008-06-26 17845, 2008
duckman joined the channel
2008-06-26 17829, 2008
nikki has quit
2008-06-26 17830, 2008
nikki_ joined the channel
2008-06-26 17812, 2008
hangy joined the channel
2008-06-26 17824, 2008
`duckman joined the channel
2008-06-26 17842, 2008
nikki_
nikki_ is now known as nikki
2008-06-26 17851, 2008
duckman has quit
2008-06-26 17834, 2008
outsidecontext
mysql is too stupid to know how to translate subqueries to joins
2008-06-26 17823, 2008
Muz
MySQL is just stupid in general
2008-06-26 17847, 2008
stochasticism has quit
2008-06-26 17804, 2008
outsidecontext has left the channel
2008-06-26 17815, 2008
warp likes mysql (ignorance is bliss).
2008-06-26 17809, 2008
Muz heads homewards.
2008-06-26 17851, 2008
Wizzcat
as long as you don't do anything advanced mysql works just fine
2008-06-26 17801, 2008
tolsen has quit
2008-06-26 17817, 2008
warp
Wizzcat: i usually don't, no.
2008-06-26 17834, 2008
nxmehta joined the channel
2008-06-26 17809, 2008
srotta
Well, it works pretty well with advanced stuff, too. Depending on what you define advanced.
2008-06-26 17859, 2008
ruaok
in terms of mysql, keeping data in a single table seems pretty advanced. :)
2008-06-26 17853, 2008
srotta
Nowadays it holds multiple engines under the same product, and they have pretty different feature sets.
2008-06-26 17824, 2008
srotta
One could say they are stupid in different ways, but it's really not that bad.
2008-06-26 17855, 2008
Wizzcat
performance on advanced features is terrible and with lots of restrictions
2008-06-26 17806, 2008
warp
Wizzcat: in general, or with mysql?
2008-06-26 17828, 2008
srotta has quit
2008-06-26 17817, 2008
VxJasonxV
ruaok, aaaaaaaaaaaand. I have bzr picard repo on intel and ppc :)
2008-06-26 17831, 2008
Wizzcat
warp: with mysql
2008-06-26 17827, 2008
ruaok
VxJasonxV: great. do they run yet?
2008-06-26 17842, 2008
VxJasonxV
haven't tried :P
2008-06-26 17807, 2008
VxJasonxV
I'm stil in the middle of changing a whole bunch of stuff. I Think I'll have a chance to try it tonight.
2008-06-26 17836, 2008
VxJasonxV
not to mention at work
2008-06-26 17851, 2008
VxJasonxV
(big rollout of hardware at work, hence why I'll try tonight)
2008-06-26 17819, 2008
ruaok
k
2008-06-26 17832, 2008
ruaok
you need to install a ton of dependencies first. :(
2008-06-26 17849, 2008
ruaok
brb
2008-06-26 17850, 2008
ruaok has quit
2008-06-26 17853, 2008
VxJasonxV
gimme a list, and macports will be my best f...
2008-06-26 17855, 2008
VxJasonxV
friend :(
2008-06-26 17843, 2008
chelz has left the channel
2008-06-26 17803, 2008
ruaok joined the channel
2008-06-26 17818, 2008
CatCat
omg ppc mac picard port yes go!
2008-06-26 17831, 2008
CatCat
holey carp the mother of all lightning stormes are here now
2008-06-26 17833, 2008
Wizzcat
lightning storms are fun ok
2008-06-26 17858, 2008
Zharf
I love thunderstorms
2008-06-26 17843, 2008
ruaok
I wish we'd get them more often here.
2008-06-26 17848, 2008
ruaok
I'd be taking pictures a plenty...
2008-06-26 17854, 2008
VxJasonxV
ruaok, get me a list of dependencies and macports will be my best friend to install them with