Hi,
try this,

select username, first_name,last_name, name as contact
from user,contact
where user.id=contact.user_id
order by username;

Mathias


Selon Jerry Swanson <[EMAIL PROTECTED]>:

> How to select 5 records(including username, first_name, last_name,
> contact) for each user in the database?
>
> table user(
>       id,
>       username,
>       first_name,
>       last_name
> )
>
> contact(
>       id
>       id_user //id from user table
>       name
> )
>
> --
> 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