RE: Complex select statement

2003-07-16 Thread Rudy Metzger
] Subject: RE: Complex select statement Still having a problem with this. Still have one last thing that isn't working. This is MySQL 4.0.13. UPDATE table_tmp,table2_daily SET table_tmp.period_count = table_tmp.count - table2.count WHERE table_tmp.id = table2.id AND MAX(table2.timestamp

RE: Complex select statement

2003-07-15 Thread Roy Walker
! Please! :) Roy -Original Message- From: Rudy Metzger [mailto:[EMAIL PROTECTED] Sent: Monday, July 14, 2003 3:49 AM To: Roy Walker; [EMAIL PROTECTED] Subject: RE: Complex select statement I never heard before that you can use a select statement in an arithmetic expression. Only ALL, ANY, MIN

Re: Complex select statement

2003-07-15 Thread Michael Iatauro
As far as I know, MAX only returns the greatest row, so what you really want at the end is WHERE table_tmp.id=table2.id AND table2.timestamp=MAX(table2.timestamp) ~MJI Roy Walker wrote: Still having a problem with this. Still have one last thing that isn't working. This is MySQL 4.0.13.

RE: Complex select statement

2003-07-15 Thread Roy Walker
To: [EMAIL PROTECTED] Subject: Re: Complex select statement As far as I know, MAX only returns the greatest row, so what you really want at the end is WHERE table_tmp.id=table2.id AND table2.timestamp=MAX(table2.timestamp) ~MJI Roy Walker wrote: Still having a problem with this. Still have

RE: Complex select statement

2003-07-14 Thread Rudy Metzger
be the way how I would do it in a different DB (e.g. ORACLE). Cheers /rudy -Original Message- From: Roy Walker [mailto:[EMAIL PROTECTED] Sent: vrijdag 11 juli 2003 18:30 To: [EMAIL PROTECTED] Subject: RE: Complex select statement Eva, Thanx for your help. Still having an issue

RE: Complex select statement

2003-07-11 Thread Roy Walker
to use a variable (... SELECT @id1:=id ... WHERE [EMAIL PROTECTED] ...). i just corrected a few syntax mistakes in your query. eva -Original Message- From: Roy Walker [mailto:[EMAIL PROTECTED] Sent: Friday, July 11, 2003 7:19 AM To: [EMAIL PROTECTED] Subject: Complex select statement

Re: Complex select statement

2003-07-11 Thread Egor Egorov
Roy Walker [EMAIL PROTECTED] wrote: Thanx for your help. Still having an issue with this. I forgot to mention I am running MySQL 4.0.13. Tried both of these statements: INSERT INTO table2 (id,count,period_count,date) SELECT id as id1, count, (count - (SELECT count FROM table2 WHERE

RE: Complex select statement

2003-07-11 Thread Roy Walker
PROTECTED] Sent: Friday, July 11, 2003 11:52 AM To: [EMAIL PROTECTED] Subject: Re: Complex select statement Roy Walker [EMAIL PROTECTED] wrote: Thanx for your help. Still having an issue with this. I forgot to mention I am running MySQL 4.0.13. Tried both of these statements: INSERT

Re: Complex select statement

2003-07-11 Thread Nils Valentin
: Parackov Eva, Ing [mailto:[EMAIL PROTECTED] Sent: Friday, July 11, 2003 12:30 AM To: Roy Walker Subject: RE: Complex select statement try this: INSERT INTO table2 (id,count,period_count,date) SELECT id as id1, count, (count - (SELECT count FROM table2 WHERE id=id1 order by timestamp desc

Complex select statement

2003-07-10 Thread Roy Walker
If anyone could tell me what I am doing wrong here, I would greatly appreaciate it. Have the following tables: table1: id, count table2: id, count, period_count, date, timestamp Trying to do the following; get all rows from table 1 and insert them into table2 while setting period_count to

Help with a semi-complex select statement..

2001-05-23 Thread Chad Day
I have 4 tables, named: players - stores player id, name, team id teams - teamid, teamname goals - goals scored, player id, team id penalty - penaltys accumulated, player id What I'm trying to do is write a query to get the top 10 from any category and display them. I can do them individually

RE: Help with a semi-complex select statement..

2001-05-23 Thread Ravi Raman
order by TPM desc limit 10; (this may or may not work/parse properly, as i didn't actually try it, YMMV, etc.etc.etc.) -ravi. -Original Message- From: Chad Day [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 23, 2001 10:59 AM To: [EMAIL PROTECTED] Subject: Help with a semi-complex select