Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is there anyway to speed this up by optimizing/condensing the code?

SELECT fullName, email_address, pos_desc, EXT 
FROM dbo.BTC_WEB_EMPLOYEE_VIEW 
WHERE grp_cde = 'STAFF' 
OR grp_cde = 'PROF' 
OR grp_cde = 'EXEC' 
OR grp_cde = 'ADMIN' 
OR grp_cde = 'FAC' 
ORDER BY last_name
share

migration rejected from stackoverflow.com Jun 6 '13 at 0:09

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as not a real question by Paul White, RolandoMySQLDBA, Marian, ypercube, Max Vernon Jun 6 '13 at 0:09

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

3  
Are you sure about dbo and mysql? Looks like sqlserver instead... –  Lukas Eder Jun 5 '13 at 12:50
1  
Well, you could put an index on grp_code in the table (if there isn't one already), but that's changing the database structure, not the code itself. –  Jonathan Jun 5 '13 at 12:52
    
check if there's an index on grp_Cde, and if not, add one and run it again. –  Charles Bretana Jun 5 '13 at 12:52
    
This comes from ASP page SelectCommand –  Chaddly Jun 5 '13 at 12:52
    
where grp_cde in('STAFF','PROF','EXEC','ADMIN','FAC') This won't speed up the select, but it does condense the code. –  StanleyJohns Jun 5 '13 at 18:06