Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SELECT AND OR ??

Author  Topic 

drewst
Starting Member

2 Posts

Posted - 2004-10-09 : 16:52:31
hi i want to search a table containing football fixtures and want to fins any game either home or away between two teams

i want to do this

SELECT whatever FROM table

WHERE hometeam = '$HT' AND awayteam = '$AT' ........ OR

hometeam = '$AT' AND awayteam = '$HT'

how do i stucture the query i mean you cant use brackets like this

( hometeam == X && awayteam == Y ) || ( etc..)

Please help i cant find the answer anywhere

Thanks

Drew

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-10-09 : 17:20:33
WHERE
(hometeam = '$HT' AND awayteam = '$AT')
OR (hometeam = '$AT' AND awayteam = '$HT')


Corey
Go to Top of Page

drewst
Starting Member

2 Posts

Posted - 2004-10-09 : 20:51:55
Thanks mate,
why did i not think it was that easy :)

Drew
Go to Top of Page
   

- Advertisement -