15 messages in com.mysql.lists.mysqlRe: Query Help
FromSent OnAttachments
Pink...@aol.com29 Aug 2001 14:56 
Pink...@aol.com29 Aug 2001 16:10 
Islam, Sharif04 Sep 2001 14:42 
Deryck Henson04 Sep 2001 14:48 
Carl Troein04 Sep 2001 15:05 
Paul DuBois04 Sep 2001 15:09 
mick...@bellsouth.net05 Sep 2001 16:10 
Ian Moore05 Sep 2001 16:26 
Henning Schroeder05 Sep 2001 16:26 
mick...@bellsouth.net05 Sep 2001 16:36 
Ian Moore05 Sep 2001 16:37 
Michael Garvin05 Sep 2001 16:43 
mick...@bellsouth.net05 Sep 2001 17:57 
Henning Schroeder05 Sep 2001 18:08 
mick...@bellsouth.net05 Sep 2001 18:18 
Subject:Re: Query Help
From:mick...@bellsouth.net (mick@bellsouth.net)
Date:09/05/2001 04:36:45 PM
List:com.mysql.lists.mysql

Thanks,

OK, I think I see where I was going wrong! :) We'll work at it again.

Appreciate the help from the list.

On Thu, 06 Sep 2001 01:27:21 +0200, Henning Schroeder <hgsc@web.de> wrote:

okay,

"extract all the tagnumbers,days and expdate"

select tagnumber, days, expdate from membership, tags

"where the orderid equals the tagid"

where orderid=tags.tagid and tags.tagid=membership.id;

i´m not quite sure if I understood you correctly. above query gets you your data joining the tables together on identical tagids and selecting all rows where tags.tagid=tags.orderid. is that what you wanted? otherwise, ask...

greetings,

I got a sql query I seemed to be missing the obvious or just can't see. Database Table structure: CREATE TABLE `membership` ( `tagid` int(8) NOT NULL default '0', `startdate` date NOT NULL default '0000-00-00', `expdate` date NOT NULL default '0000-00-00', `days` smallint(4) NOT NULL default '0', PRIMARY KEY (`tagid`), KEY `days` (`days`) )

CREATE TABLE `tags` ( `tagid` int(8) NOT NULL auto_increment, `orderid` int(8) NOT NULL default '0', `finderid` int(8) NOT NULL default '0', `tagnumber` varchar(10) NOT NULL default '', PRIMARY KEY (`tagid`), UNIQUE KEY `tagnumber` (`tagnumber`), KEY `orderid` (`orderid`,`finderid`) );

What I need to do is extract all the tagnumbers,days and expdate where the orderid equals the tagid in both the "tags" and "membership" tables.

Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! http://www.thunder-rain.com Tel: 1(225)686-2002 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=