Re: SQL

2014-09-17 Thread Laurie Alvey
Actually you don't need to specify INNER, the keyword JOIN by itself is implicitly an INNER JOIN. You only need the full syntax when you're using an OUTER JOIN (FULL, LEFT, or RIGHT). Laurie On 17 September 2014 03:39, Sytze de Boer sytze.k...@gmail.com wrote: Frank, perfect I really need to

Re: SQL

2014-09-17 Thread Jean MAURICE
Le 17/09/2014 09:41, Laurie Alvey a écrit : Actually you don't need to specify INNER, the keyword JOIN by itself is implicitly an INNER JOIN. You only need the full syntax when you're using an OUTER JOIN (FULL, LEFT, or RIGHT). Laurie That's true but when you read your query some years later,

Re: SQL

2014-09-17 Thread Peter Cushing
Sytze de Boer wrote: Frank, perfect I really need to study this inner and outer stuff Recommend this book. Surprisingly the link allowed me to save the entire PDF. http://josuevillegas.com/books/SQL_The_Complete_Reference.pdf Chapter 6 starts with simple queries. Peter

Re: SQL

2014-09-17 Thread Paul Hill
On 17 September 2014 09:25, Jean MAURICE jsm.maur...@wanadoo.fr wrote: Another point : it's better to use local aliases in your query at least for the human being reading it : Select h.date, h.invnum, h.prodcode, h.qty, s.name ; From winhist h Inner join winstocks s on h.prodcode = s.prodcode

Re: SQL

2014-09-17 Thread Alan Bourke
On Wed, 17 Sep 2014, at 11:31 AM, Paul Hill wrote: I disagree. This is very unreadable. I'd be of the same opinion - I wouldn't use aliases unless forced to. -- Alan Bourke alanpbourke (at) fastmail (dot) fm ___ Post Messages to:

Re: SQL

2014-09-17 Thread Peter Cushing
Jean MAURICE wrote: That's true but when you read your query some years later, it's easier to remember what it does when 'inner' is written !! Another point : it's better to use local aliases in your query at least for the human being reading it : Select h.date, h.invnum, h.prodcode, h.qty,

Re: SQL

2014-09-17 Thread Ted Roche
I think it's delightful that everyone is entitled to their own opinion. Style in SQL is a pretty individualistic thing. I capitalize SQL command terms I wouldn't use the 'h' table alias, as FoxPro can, under some circumstances, interpret the single letters a through j as shortcuts to the first 10

Re: SQL

2014-09-17 Thread Peter Cushing
Ted Roche wrote: snip dropping a join term is usually not what you want to do (and can result in a huge cartesian join result that's rarely what you want and often and can crash or impair the machine). Oh no, never been caught out by that one ;-) Peter

order/group

2014-09-17 Thread Sytze de Boer
With a customised option to print monthly statements, I need to do the following 1 I need to have all the entries for the client ordered by invoice number 2 but also in date order (Date are set british) Example Date Invnum QtyAmount Desc 21/7/2014 10001

Re: order/group

2014-09-17 Thread Tracy Pearson
On September 17, 2014 9:40:47 PM EDT, Sytze de Boer sytze.k...@gmail.com wrote: With a customised option to print monthly statements, I need to do the following 1 I need to have all the entries for the client ordered by invoice number 2 but also in date order (Date are set british) Example

Re: order/group

2014-09-17 Thread Sytze de Boer
Sorry Tracy, I don't follow this. On Thu, Sep 18, 2014 at 1:44 PM, Tracy Pearson tr...@powerchurch.com wrote: On September 17, 2014 9:40:47 PM EDT, Sytze de Boer sytze.k...@gmail.com wrote: With a customised option to print monthly statements, I need to do the following 1 I need to

Re: order/group

2014-09-17 Thread Eurico Chagas Filho
Two ways; U can order the file using DTOS(date)+BINTOC(Invnum) or U can use a SQL statement w ORDER BY . E. On Wednesday, September 17, 2014 10:49 PM, Sytze de Boer sytze.k...@gmail.com wrote: Sorry Tracy, I don't follow this. On Thu, Sep 18, 2014 at 1:44 PM, Tracy Pearson

Re: order/group

2014-09-17 Thread Eurico Chagas Filho
On Wednesday, September 17, 2014 11:41 PM, Eurico Chagas Filho e28cha...@yahoo.com.br wrote: Two ways; U can order the file using DTOS(date)+BINTOC(Invnum) or U can use a SQL statement w ORDER BY . E. On Wednesday, September 17, 2014 10:49 PM, Sytze de Boer sytze.k...@gmail.com

Re: order/group

2014-09-17 Thread Stephen Russell
On Wed, Sep 17, 2014 at 8:40 PM, Sytze de Boer sytze.k...@gmail.com wrote: With a customised option to print monthly statements, I need to do the following 1 I need to have all the entries for the client ordered by invoice number 2 but also in date order (Date are set british) Example

Re: SQL

2014-09-17 Thread Gene Wirchenko
At 04:25 2014-09-17, Ted Roche tedro...@gmail.com wrote: I think it's delightful that everyone is entitled to their own opinion. Style in SQL is a pretty individualistic thing. I capitalize SQL command terms Let the wars begin? I wouldn't use the 'h' table alias, as FoxPro can, under