If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > mysql join problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-22-03, 04:44
Xia Xia is offline
Registered User
 
Join Date: Nov 2003
Posts: 5
mysql join problem

I have this query;

SELECT table1.Title, table2.ID, table2.Val FROM table1 INNER JOIN table2 ON table1.No = table2.No WHERE table1.TitleLike '%keyword%' AND ( table2.ID = 50 OR table2.ID = 51 OR table2.ID = 52 OR table2.ID = 53 ) ORDER BY table1.Title;

but now I get four rows of results, one for each table2.ID, I tried group BY table1.Titlebut then it only shows the first table2.ID and the rest isn't shown, how should i fix it, I want 1 row for every table1.Title

Thank you

Last edited by Xia; 12-22-03 at 04:47.
Reply With Quote
  #2 (permalink)  
Old 12-22-03, 06:01
omiossec omiossec is offline
Registered User
 
Join Date: Jan 2003
Location: Paris, France
Posts: 320
please describe what you want to do with this query.

If you need to list each related row from table2

Or just a one row ?
__________________
Olivier Miossec
--
http://www.lasso-developpeur.net/
--
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On