RE: HELP! sql command question for mysql

2005-08-11 Thread Ben Smith
om: Scott Noyes [mailto:[EMAIL PROTECTED] Sent: 11 August 2005 15:39 To: Ben Smith Cc: mysql@lists.mysql.com Subject: Re: HELP! sql command question for mysql > It appears that you don't need to > specify in the Group By clause all the columns that are referenced > without an agg

Re: HELP! sql command question for mysql

2005-08-11 Thread Michael Stassen
Scott Noyes wrote: It appears that you don't need to specify in the Group By clause all the columns that are referenced without an aggregate function True. For example this query would be invalid in MSSQL but valid in MySQL: select id, vendor, sum(price) from p group by id In this cas

Re: HELP! sql command question for mysql

2005-08-11 Thread Scott Noyes
> It appears that you don't need to > specify in the Group By clause all the columns that are referenced without > an aggregate function True. > For example this query would be invalid in MSSQL but > valid in MySQL: > > select id, vendor, sum(price) > from p > group by id In this case, `vendor

RE: HELP! sql command question for mysql

2005-08-11 Thread Ben Smith
id, vendor Each query giving a different result. Regards Ben. -Original Message- From: Gleb Paharenko [mailto:[EMAIL PROTECTED] Sent: 10 August 2005 23:29 To: mysql@lists.mysql.com Subject: Re: HELP! sql command question for mysql Hello. I'm not sure about the speed of this quer

Re: HELP! sql command question for mysql

2005-08-11 Thread Gleb Paharenko
Hello. I'm not sure about the speed of this query, but it seems to work: mysql> source g.sql +---+---++ | id| price | vendor | +---+---++ | OG012 |20 | b | | OG013 |40 | c | +---+---++ [EMAIL PROTECTED] mysql-deb

HELP! sql command question for mysql

2005-08-10 Thread Joe Culler
Hello there, first of all, my english isn't good, hope you understand what I mean. I have a table name "p" like that: mysql> select * from p; +---+---++ | id| price | vendor | +---+---++ | OG012 |40 | a | | OG012 |20 | b | | OG012 |20 | c

Re: sql command question

2001-09-04 Thread Paul DuBois
>currently, to list the last 100 records in a table I use this sql command: > >select * from test order by T desc limit 100; >Note: "T" is the name of a field in my table "test" . > >can I instead use record number or use the count function to get the >same result? MySQL doesn't really have the

sql command question

2001-09-04 Thread Nissim Lugasy
currently, to list the last 100 records in a table I use this sql command: select * from test order by T desc limit 100; Note: "T" is the name of a field in my table "test" . can I instead use record number or use the count function to get the same result? I don't have an index field in my tab