Jump to content

SELECT IN()


dreamwest

Recommended Posts

I have a simple select but it wont return the values i need, maybe someone can tell me why its doing this:

 

Table 1:

 

            v_id v_word

70 south

69 park

68 brub

67 brrub

66 brrrrub!

 

Table2:

 

                l_id l_word_id        l_vid_id

70 70,69,68,67,66 834785

 

SELECT * FROM  `vid_loc` AS l, vid_words AS v WHERE MATCH v.v_word AGAINST ('south park' IN BOOLEAN MODE) AND v.v_id IN (l_word_id) 
GROUP BY v.v_id 

 

This returns:

 

l_id l_word_id               l_vid_id v_id v_word

70 70,69,68,67,66 834785 70 south

 

but this selects the two rows i need:

SELECT * FROM  `vid_loc` AS l, vid_words AS v WHERE MATCH v.v_word AGAINST ('south park' IN BOOLEAN MODE) AND v.v_id IN (70,69,68,67,66) 
GROUP BY v.v_id 

 

This returns:

 

l_id l_word_id        l_vid_id v_id v_word

70 70,69,68,67,66 834785 69 park

70 70,69,68,67,66 834785 70 south

 

 

So the question is:  IN (l_word_id)  and  IN (70,69,68,67,66) both have the same value but why do they return different results?

 

Link to comment
https://forums.phpfreaks.com/topic/220620-select-in/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.