troubleshooting Question

SQL Search Query String

Avatar of Erika Koelle
Erika KoelleFlag for United States of America asked on
5 Comments1 Solution89 ViewsLast Modified:
I have a project that just had the parameters changed.  It used to be that an employee logs in and see's the work that's assigned to them only.  Now the employee is supposed to sign in and see their job assignments first and then other job assignments.  In the old days the command was select * from table where employee = 'john'

Name:   Job Stop:
John      123 Main St
John      876 Oak Ave
John      345 Maple Road

This was fine because the person in charge of operations just wanted names and the order of the database which was imported from an Excel spreadsheet to remain the same.  Now from a logic perspective, I'm not quite sure how to do a:
select * from table where [employee] = 'john' -- list these first in no order other than how originally in database and then list all the others
I guess I could be sloppy and have a 2nd select there such as:
select * from table where not [employee] = 'john'

Name:   Job Stop:
John      123 Main St
John      876 Oak Ave
John      345 Maple Road
Tom      643 Birch St
Tom      222 Rose Ave
Bob      909 Sky Drive
Josh      877 Park Ave

Thanks in advance...
Technology Scientist

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros