NinjaLink -2 Posting Pro in Training

Is there a way to create a program to rewrite a query in an optimal form. If so, how? I already connected MYSQL to Java. I just need ideas on how to implement it. Thanks.

Rewrite:

SELECT EMPOYEE.EMPNO, POSITION
FROM EMPLOYEE E, JOBHISTORY J
WHERE E.EMPNO = J.EMPNO
AND STARTDATE <= ENDDATE
AND SALARY <= 3000

into

SELECT EMPLOYEE.EMPNO, POSITION
FROM EMPLOYEE E, JOBHISTORY J
WHERE E.EMPNO = J.EMPNO
AND SALARY <= 3000;


because "AND STARTDATE <= ENDDATE is not needed in the first query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.