Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT WHERE a AND b OR y AND Z

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
Hi,

Is it possible to make this SELECT statement any shorter? Or does SQL require that there is zero room for ambiguity?

SELECT FirstName, Surname, UserID FROM Users
WHERE FirstName ='aaa' AND Boardroom=FALSE
OR Surname LIKE 'aaa' AND Boardroom=FALSE

Ideally would want to avoid having to specify Boardroom being FALSE twice.

Thanks

Ed

 
Code:
SELECT FirstName, Surname, UserID FROM Users
WHERE (FirstName ='aaa' OR Surname LIKE 'aaa') AND Boardroom=FALSE

[blue]Typos, that don't affect the functionality of code, will not be corrected.[/blue]

Martin Serra Jr.
[blue]Database_Systems and _Applications shared across all Business_Areas[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top