[Gllug] OT: MySQL : arrgh no subqueries

Ian Norton bredroll at darkspace.org.uk
Wed Jul 9 11:35:11 UTC 2003


as it happens, it is in perl :-)

apart from using 2 queries instead of one to create this (not very often used)
list of stuff i think i will stick with deleting it, actually means less
headaches later when things refer to groups that shouldnt be there any more,
but really actually turn out to be there anyway:-)

self->confused(1);

Ian

On Wed, Jul 09, 2003 at 07:40:14AM -0400, Ian Scott wrote:
> > SELECT Content.name, Groups.gid, Groups.groupname
> > FROM Content.Groups
> > WHERE Content.gid = Groups.gid;
> > All works nicely,
> > but,
> > If an item in Content is owned by a Group that has been deleted from
> > Groups
> > then it is totally omitted in the above results,
> > What i want is to return the Content.name of all the objects that were
> > not
> > listed from Content by the previous query,
> > confused yet?
> > 
> 
> Lateral thoughts:
> 
> 1)How about capturing the results from
> select name,gid from Content;
> select gid from groups;
> and parsing the two with perl/shell/sinclair basic/whatever turns you on?
> 
> 2) Don't delete groups.  Have a isDeleted flag instead, so you get around this
> problem in future.
> 
> Ian
> 
> -- 
> Gllug mailing list  -  Gllug at linux.co.uk
> http://list.ftech.net/mailman/listinfo/gllug

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS dpu s--: a-- C++++ UL++ P+++ L+++ E--- W-- N+ o K w---
O M-- V-- PS++ PE-- Y+ PGP+ t+++ 5++ X++ R+++ !tv b DI D----
G++ e+ h++ r++ y+++
------END GEEK CODE BLOCK------
----- Message of the Hour ------
Moooo :-)

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list