select * from employees where mod(emp_no, 2) = 1 and last_name != 'Mary' order by hire_date desc
此题的重点,在于“取奇”数, mod(a, b)=1/0 ,
(1)mod(a,b) 在sql中的意思是 a / b 的余数
(2) mod(id, 2)=1 是指id是奇数。 mod(id, 2)=0 是指id是偶数。
select * from employees where mod(emp_no, 2) = 1 and last_name != 'Mary' order by hire_date desc
此题的重点,在于“取奇”数, mod(a, b)=1/0 ,
(1)mod(a,b) 在sql中的意思是 a / b 的余数
(2) mod(id, 2)=1 是指id是奇数。 mod(id, 2)=0 是指id是偶数。