hi all
basically i want to merge these two queries
the query below, eg. returns 100 recordsCode://get the user's id SELECT user_ID, user_Nick FROM urban_userlog ORDER BY user_LoggedInDate DESC, user_LoggedInTime DESC //get the id of a user that i have not voted for in the past hour SELECT uservotelog_VoteeUserID FROM urban_uservotelog WHERE uservotelog_VoterUserID <> '1' AND UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(uservotelog_DateTime) < 3600
with the timestamp part taken out, it returns eg. 1000 records
even though i may have voted for only 20 users
so the query below, should return eg. 980 records
all the relavant fields are there, table name is what is before the underscore
votelog contains all vote details, userlog contains user details
just checked, in fact the query above returns records that i have already seen as wellCode:SELECT DISTINCT user_ID, user_Nick FROM urban_userlog LEFT OUTER JOIN urban_uservotelog ON user_ID = uservotelog_VoteeUserID WHERE uservotelog_VoterUserID <> '1' AND UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(uservotelog_DateTime) < 3600 ORDER BY user_LoggedInDate DESC, user_LoggedInTime DESC
when i run a query to select who i have voted for in the past hour or half hour using that timestamp method
it returns the correct result
thanks
dave








Bookmarks