the idea is:
table1:
id own
1    A
2    B
3    A
4    C

table2:
id type
1    3
1    4
1    2
3    4
3    5
4    1

I need as result

query:
own  type
A       2
A       5
C       1

Thanks in advance


----- Original Message ----- 
From: "Michael Satterwhite" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 09, 2004 10:29 AM
Subject: Re: Last record


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 09 February 2004 08:44, Patricio Gigoux wrote:
> Hi:
> How Can I do for after a query I put at the its last record?

I'm not sure I followed the question, but I think you're asking how to look
at
the last record in the set you just returned. If so, the easiest way is to
do
a descending sort. For example Assume a table as follows:

Table1
ID Value
    -------- ----------
1 23
2 30
3 45

Then

Select * from Table1 Order by ID Desc;

Will return

ID Value
     -------- --------
3 45
2 30
1 23

Now the *FIRST* record you will see is the last record in the set.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux)

iD8DBQFAJ5lEjeziQOokQnARAsmPAJ96yzc+WcieFt5cj2zMLvAIY17nSQCgh8XS
rciGckLMnLCqkfvf3z+GqSU=
=hwzq
-----END PGP SIGNATURE-----


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to