Re: basic sql join question...

2005-05-30 Thread mfatene
re-send : Hi, you can use mysql variables : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; ++---+--+--+---+ | name | price | quantity | subtotal | @total:[EMAIL PROTECTED

Re: basic sql join question...

2005-05-29 Thread Philip George
On May 30, 2005, at 1:28 AM, [EMAIL PROTECTED] wrote: you can just play : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; select @total as "grand total"; works great. thanks very, very much. - philip -- MySQL General

Re: basic sql join question...

2005-05-29 Thread mfatene
Hi Philip, what yoy called gand total is in @total for evevy row. you can just play : > > set @total:=0; > > select name,price,quantity, price*quantity as > > subtotal,@total:[EMAIL PROTECTED] > > from fruits; select @total as "grand total"; that's all ! Mathias Selon Philip George <[

Re: basic sql join question...

2005-05-29 Thread mfatene
Hi, you can use mysql variables : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; ++---+--+--+---+ | name | price | quantity | subtotal | @total:[EMAIL PROTECTED] | ++

Re: basic sql join question...

2005-05-29 Thread Philip George
On May 29, 2005, at 2:34 PM, [EMAIL PROTECTED] wrote: you can use mysql variables : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; ++---+--+-- +---+ | name |

Re: basic sql join question...

2005-05-29 Thread mfatene
re-submitted : re-send : Hi, you can use mysql variables : set @total:=0; select name,price,quantity, price*quantity as subtotal,@total:[EMAIL PROTECTED] from fruits; ++---+--+--+---+ | name | price | quantity | subtotal

Re: basic sql join question...

2005-05-29 Thread Philip George
actually, i've decided this is sort of a moot point, since i can do this calculation in the client app. no sql required. thanks. - philip -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: basic sql join question...

2005-05-29 Thread Jochem van Dieten
On 5/29/05, Philip George wrote: > On 5/29/05, Philip George wrote: >> On 5/29/05, Jochem van Dieten wrote: >>> http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html >> >> already read that. the join in my example is more complicated than >> anything depicted on that page. >> >> please explai

Re: basic sql join question...

2005-05-29 Thread Philip George
The join is irrelevant. Your join returns a resultset and you can just pretent that resultset is a single table: SELECT field1, field2, field3 FROM (very complicated join) AS simpletable GROUP BY ... WITH ROLLUP Just copy-pate your join into this and fix the fieldnames. aaahhh okay, i'm

Re: basic sql join question...

2005-05-29 Thread Philip George
http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html already read that. the join in my example is more complicated than anything depicted on that page. please explain. actually i should say that there are no examples of SUM() or AVG() -- or any of the other GROUP BY functions -- th

Re: basic sql join question...

2005-05-29 Thread Jochem van Dieten
On 5/29/05, Philip George wrote: > On May 29, 2005, at 1:41 AM, Jochem van Dieten wrote: >> >> http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html > > already read that. the join in my example is more complicated than > anything depicted on that page. The join is irrelevant. Your join retu

Re: basic sql join question...

2005-05-28 Thread Philip George
On May 29, 2005, at 1:41 AM, Jochem van Dieten wrote: http://dev.mysql.com/doc/mysql/en/group-by-modifiers.html already read that. the join in my example is more complicated than anything depicted on that page. please explain. - philip -- MySQL General Mailing List For list archives:

Re: basic sql join question...

2005-05-28 Thread Jochem van Dieten
On 5/29/05, Philip George <[EMAIL PROTECTED]> wrote: > > +--++---+--+ > | quantity | name | price | subtotal | > +--++---+--+ > |1 | orange | 0.97 | 0.97 | > |3 | pear | 1.09 | 3.27 | > +--++-

Re: basic sql join question...

2005-05-28 Thread Philip George
t 11:36 PM, Philip George wrote: is it okay to post a basic sql join question to this list? if not, please point me to a list for these types of questions. thanks. - philip -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com

basic sql join question...

2005-05-28 Thread Philip George
is it okay to post a basic sql join question to this list? if not, please point me to a list for these types of questions. thanks. - philip -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: Basic SQL join question

2002-09-24 Thread John Ragan
logic. > > > > hth, > > Arthur > > > > -Original Message- > > From: Adam Randall [mailto:[EMAIL PROTECTED]] > > Sent: Saturday, September 21, 2002 5:18 AM > > To: [EMAIL PROTECTED] > > Subject: Basic SQL join question > > >

Re: Basic SQL join question

2002-09-24 Thread Arthur Fuller
ptember 24, 2002 12:46 PM Subject: RE: Basic SQL join question > > SELECT * > > FROM Projects > > INNER JOIN KeywordLink ON Projects.Id = KeywordLink.Pid > > INNER JOIN Keywords KeywordLink.Kid = Keywords.Id > > WHERE Keyword LIKE '%historical%' AND >

RE: Basic SQL join question

2002-09-24 Thread Josh Trutwin
" logic. > > hth, > Arthur > > -Original Message- > From: Adam Randall [mailto:[EMAIL PROTECTED]] > Sent: Saturday, September 21, 2002 5:18 AM > To: [EMAIL PROTECTED] > Subject: Basic SQL join question > > > Okay, I've thought about this every way I

RE: Basic SQL join question

2002-09-24 Thread Arthur Fuller
I prefer the clarity obtained by keeping it in JOIN clauses and using the WHERE only to contain the "include if" logic. hth, Arthur -Original Message- From: Adam Randall [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 21, 2002 5:18 AM To: [EMAIL PROTECTED] Subject: Basic

Basic SQL join question

2002-09-21 Thread Adam Randall
Okay, I've thought about this every way I can conceive of, but I cannot figure out the sql query logic involved in joining three tables together. Here is what I am trying to do: I have three tables: keywords keywordlink projects keywords has these fields: id keyword keywordlink has th

SQL join question

2002-04-03 Thread Steven Hajducko
Alright, I've got a little bit of a problem with this query. This is what the current query looks like ( I know I'm doing it wrong, I just don't know how to fix it.. I'm not that familiar with the LEFT JOIN/subquery stuff.. ) select cluster.cid, cluster.isp, cluster.country_id-20 as Country_

Re: Hopefully Easy SQL Join Question

2001-02-22 Thread Thalis A. Kalfigopoulos
On Thu, 22 Feb 2001, Oson, Chris M. wrote: > Good Day All > > I have two tables... > > Table 1 > --- > MSRSectionID ContractID Heading > 1 > 1 107 Technical Progress: > 7107 Tec

Hopefully Easy SQL Join Question

2001-02-22 Thread Oson, Chris M.
Good Day All I have two tables... Table 1 --- MSRSectionID ContractID Heading 1 1107 Technical Progress: 7107 Technical Problems: 13 107 Administrative Acti