I have a mySql stored procedure that looks like this:
delimiter |
create procedure GetEmployeeById(in ID varchar(45))
begin
select id,
firstName,
lastName,
phone,
address1,
address2,
city,
state,
zip,
username,
password,
emptypeid
from myschema.tblemployees t
where
t.id=ID limit 1;
end |
delimiter;
If I do not have limit 1 in place, it always returns all the rows in the table - with each record identifier value set to the ID parameter. Why can't I use id id and why does it return all records when I do this? What are the consequences of using limit 1? Why am I programming on Saturday?
Micah source
share