[thesite] database: content table

Warden, Matt mwarden at odyssey-design.com
Fri May 25 23:47:40 CDT 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I started reading your reply, then i got distracted (I think it was
dan's fault) and for some reason thought I had already read it all.
Sorry.

> as to your query, matt, what exactly is it you're looking for?  if
> all you want is the highest date, at the same time as retrieving
> the other stuff about an article, then you probably want to use
> something like this (caution: not tested) --
> 
> select
>     contentid, replies, categoryid, contentname,
>         (select max(datemod) from replies
>              where contentid = content.contentid) as
> lastcommentdate from
>     content
> where
>     replies > 13
>     and contentid <> 3509

I was under the impression that subqueries were never the best way to
go performance-wise. Is this not correct?

> where did you get the (arbitrary?) number 13 from?  i know you are
> selecting articles with more than 13 comments, but why 13

It's a copy&paste from the current query.

> and what's contentid <> 3509?  (sorry, i'm too lazy to go into the
> database to look...)

Same. Probably FAQ?



- --
mattwarden
mattwarden.com

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBOw81ongH0dUmEhrcEQJYngCg23s+t2xQA+X/Z1TugxCrbNtRxeQAniiX
parbtfe02RE9OoWANFGzABXm
=uOrd
-----END PGP SIGNATURE-----






More information about the thesite mailing list