Rhino wrote:
I'm glad the explanation helped. I figured that the solution alone wouldn't
be very useful if it wasn't explained since it is not obvious to most people
how correlated queries work :-)
I really wasn't trying to center you out with my "rant" about MySQL version.
It's been a long-run
Rhino
- Original Message -
From: "Gobi" <[EMAIL PROTECTED]>
To:
Sent: Saturday, November 05, 2005 8:05 AM
Subject: Re: Help with an SQL query
> Rhino wrote:
>
> >I can't test this in MySQL- I'm using an older version of MySQL that
doesn't
&
Rhino wrote:
I can't test this in MySQL- I'm using an older version of MySQL that doesn't
support subqueries - but it works in DB2 and it should do the trick for
getting the current weight of each VBS_id value:
select VBS_id, date, weight
from VBS_table x
where date =
(select max(date) from VBS
Oops, I meant to post this on the list AND copy the person asking the
question
Rhino
- Original Message -
From: "Rhino" <[EMAIL PROTECTED]>
To: "Gobi" <[EMAIL PROTECTED]>
Sent: Friday, November 04, 2005 1:46 PM
Subject: Re: Help with an SQL query
&
Figured out the query:
select idx, vbs_id, date, weight from Weight,
(select vbs_id as maxid, max(date) as maxdate from Weight group by
vbs_id) as t
where vbs_id = maxid and date = maxdate;
It returns the proper weight and idx.
--
MySQL General Mailing List
For list archives: http://lists.mys
Hi Gobi,
the problem with your original query is that there is no
guarantee that your max(date) and it's associated VBS_ID
is picked, so what you have to ensure is that they get picked
together, so I think your statement should be like this:
SELECT VBS_ID,
SUBSTRING( MAX( CONCAT( LPAD( Dat
Johan Höök wrote:
Hi Gobi,
there was a similar posting in august.
See:
http://lists.mysql.com/mysql/187436
which I think describes what you want.
I'll include a bit of it here as well
--
This is out of the MySQL class and is called the Max-Concat trick.
_
Johan Höök wrote:
Hi Gobi,
there was a similar posting in august.
See:
http://lists.mysql.com/mysql/187436
which I think describes what you want.
I'll include a bit of it here as well
--
This is out of the MySQL class and is called the Max-Concat trick.
_
Hi Gobi,
there was a similar posting in august.
See:
http://lists.mysql.com/mysql/187436
which I think describes what you want.
I'll include a bit of it here as well
--
This is out of the MySQL class and is called the Max-Concat trick.
_
Gobi wrote:
Arno Coetzee wrote:
Gobi wrote:
Not sure if this is the right place to ask. I have a table, Weight,
with the following test data:
idx VBS_ID DateWeight
11110/3/200511.5
2119/5/2004 10
31110/7/200511.51
411
Arno Coetzee wrote:
Gobi wrote:
Not sure if this is the right place to ask. I have a table, Weight,
with the following test data:
idx VBS_ID DateWeight
11110/3/200511.5
2119/5/2004 10
31110/7/200511.51
41110/8/2005
Gobi wrote:
Not sure if this is the right place to ask. I have a table, Weight,
with the following test data:
idx VBS_ID DateWeight
11110/3/200511.5
2119/5/2004 10
31110/7/200511.51
41110/8/200511.52
512
Not sure if this is the right place to ask. I have a table, Weight,
with the following test data:
idx VBS_ID DateWeight
11110/3/200511.5
2119/5/2004 10
31110/7/200511.51
41110/8/200511.52
51210/8/2005
Michael Satterwhite wrote:
-
As it is, all I can suggest is to JOIN on all 90 tables - and hope MySQL
can handle the query - and that you can type all of them without error.
Note that if you use a UNION query as you suggest above, you will get
the last login FOR EACH DAY - not the overall last logi
In article <[EMAIL PROTECTED]>,
"J S" <[EMAIL PROTECTED]> writes:
> and I need to check the last date each user logged on to the proxy in
> the last 3 months.
> In my database, there is a table for the users:
mysql> desc user_table;
> +---+--+--+-+-+--
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
J S wrote:
|
|
|> J S wrote:
|> | Hi,
|> |
|> | I need a bit of help with a mySQL query. I have a list of users in a
|> | text file called 'users':
|> |
|> | u655354
|> | u687994
|> | u696974
|> | u728141
|> | ..
|> | ..
|> |
|> | and I need to check th
J S wrote:
| Hi,
|
| I need a bit of help with a mySQL query. I have a list of users in a
| text file called 'users':
|
| u655354
| u687994
| u696974
| u728141
| ..
| ..
|
| and I need to check the last date each user logged on to the proxy in
| the last 3 months.
|
| In my database, there is a ta
Hi,
I need a bit of help with a mySQL query. I have a list of users in a text
file called 'users':
u655354
u687994
u696974
u728141
..
..
and I need to check the last date each user logged on to the proxy in the
last 3 months.
In my database, there is a table for the users:
mysql> desc user_tabl
18 matches
Mail list logo