[thelist] sql statement

Ed McCarroll Ed at ComSimplicity.com
Tue Mar 29 15:52:24 CST 2005


To list all size names for product 213:

  SELECT size.name
  FROM size S
  INNER JOIN prod_size PS
    ON S.sid = PS.sid
  WHERE PS.prodid = 213

or equivalent...

-- 
Ed McCarroll                                  (310) 838-4330
Ed at ComSimplicity.com            http://www.ComSimplicity.com


Quoting Donnie Blaker <filterhead80 at hotmail.com>:

> I have two tables.  sizes and prod_size.
> 
> size has sid, name, abrv
> prod_size has sid, prodid
> 
> when I do this look up I would like in one query get the all the
> sizes for 
> that product.  normally I would do two queries but I dont think
> that is the 
> correct way.
> 
> does someone know what I would use?  like left join or join or
> something 
> like that
> 
> thanks
> 
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today -
> it's FREE! 
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> 
> -- 
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester 
> and archives of thelist go to: http://lists.evolt.org 
> Workers of the Web, evolt ! 
> 


More information about the thelist mailing list