Representing left outer join in MySQL and Rails

I have to create a query from two tables. Table 1 is the accounts table
and table 2 is the payments table. Each account can have many payments.
I have to create a query that lists all accounts with the last payment.
If there are no payments then the query displays no information for the
payments but lists the account information anyway. If there are
multiple payments then I need to pick up the last payment. Example:

id name
1 a1
2 a2

id account_id cents
1 1 500
2 1 1000

if I run the following query:

select,,, p.cents from accounts left outer join
payments p where = payments.account_id; then I get