FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Confused about a MySQL Statement
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Confused about a MySQL Statement [message #173064 is a reply to message #173062] Sat, 19 March 2011 22:06 Go to previous messageGo to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma:
Senior Member
On 19-03-2011 22:11, richard wrote:
> On Sat, 19 Mar 2011 14:05:56 -0700 (PDT), Joe wrote:
>
>> I am trying to get a list from one table, and using another table to
>> subtract from that list.
>>
>> I am trying to us:
>>
>> SELECT entry_id, entry.video_id, entry_book, entry_category, sort_cat,
>> entry_guard_fname, entry_guard_lname,
>> entry_fname, entry_lname
>> FROM entry, chosen
>> where sort_cat = 2
>> and entry.video_id in
>> (Select video_id from chosen where chosen_win = "")
>>
>> Which gives me way too may results, 4,042.
>>
>> The first part, comes up with 157 records, where the second part is
>> only 5. I want the final list to be 152.
>>
>> I have hit a wall here, and not sure where to go next. Can anyone
>> help?
>
> try asking in comp.databases.mysql

or, since you askjed in comp.lang.php

Store the 5 id's which you dont want to be resurned and loop over the
result from you first query, skipping the result if it matched any of
these 5.....

But a mysql solution might be quicker ;)

--
Luuk
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: $_POST not set on 404
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 17:49:10 GMT 2024

Total time taken to generate the page: 0.04215 seconds