Ok, lessee...

SELECT user.user_id, user_name, user_history FROM user, history 
WHERE user_history LIKE "%58%" AND user.user_id = history.user_id;

That should do what you need, lemme know.

Mike Hillyer
http://www.dynamergy.com/mike


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 05, 2003 10:41 AM
To: [EMAIL PROTECTED]
Subject: Simple SELECT question


I need a little help querying 2 tables in MySQL;

Table User
 User_Id   // Id = 2
 User_Name // John 

Table History
User_Id  // 2
User_History // John has born in 58

SELECT User_History FROM History WHERE User_Id = 2;  // return John has
born in 58

But what my SELECT should look if i don't know the user id and want search
the User_History by the User_Name?

SELECT User_History FROM History WHERE User_Id = ( SOMEWAY TO DATABASE FIND
JOHN ID BY JOHN NAME  )




------------------------------------------
Use o melhor sistema de busca da Internet
Radar UOL - http://www.radaruol.com.br




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to