I have a table, emp, and two fields, empid and empname. The column empid has a primary key. My question is, how do I get the latest entry into the empname column with a single select statement?
I'm not sure what you mean by "latest entry." To me, this implies that you are looking for the last inserted row of data. If the EMPID column is an increasing sequence, then this would be as easy as finding the row with the largest EMPID value and then finding the other column values based on the largest EMPID. The following query does just that:
SELECT empid,empname FROM emp
WHERE empid IN (SELECT MAX(empid) FROM emp);