EQaddict37 Posted June 24, 2008 Share Posted June 24, 2008 SELECT changelogs.ActivityId, changelogs.TimeHappened, userInfo.firstName, userInfo.lastName, changelogs.FormId,changelogs.BuildId, changelogs.GameId, changelogs.message //SELECT log information FROM changelogs //FROM these tables INNER JOIN userInfo ON userInfo.UserId = changelogs.UserId WHERE ( changelogs.FormId=(SELECT FormId From FormInfo Where FormNumber="2GF+V") //if correct FormNumber AND //AND (ActivityId=7 OR ActivityId=8 OR ActivityId=9 OR ActivityId=10) //A relevant activity ) OR //OR ( changelogs.GameId=(SELECT GameId From GameInfo Where Name="013s") //if correct Game AND //AND (ActivityId=11 OR ActivityId=12) //A relevant activity ) OR //OR changelogs.activityId=0 //Adminitrator broadcast order by logid DESC LIMIT 100 //ordered from newest to oldest This is the query I have com up with that worked fine with one form or one gameId, however I need to beable to put in Multiple of either or both. I tried just changing to WHERE FormNumber ="2GF+V" OR FormNumber ="2GG+V" . However that returns a "Subquery returns more than 1 row" Error. After looking at that i am not quite sure, because I have in the past done a query where "table.column = (query returning single column list)" and it worked. Edit: I remember a second latter....IN SELECT changelogs.ActivityId, changelogs.TimeHappened, userInfo.firstName, userInfo.lastName, changelogs.FormId,changelogs.BuildId, changelogs.GameId, changelogs.message //SELECT log information FROM changelogs //FROM these tables INNER JOIN userInfo ON userInfo.UserId = changelogs.UserId WHERE ( changelogs.FormId IN (SELECT FormId From FormInfo Where FormNumber="2GF+V" OR FormNumber ="2GG+V") //if correct FormNumber AND //AND (ActivityId=7 OR ActivityId=8 OR ActivityId=9 OR ActivityId=10) //A relevant activity ) OR //OR ( changelogs.GameId IN (SELECT GameId From GameInfo Where Name="013s") //if correct Game AND //AND (ActivityId=11 OR ActivityId=12) //A relevant activity ) OR //OR changelogs.activityId=0 //Adminitrator broadcast order by logid DESC LIMIT 100 //ordered from newest to oldest Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.