select * from some_table where employee_id = "$emp_id" and week_field = "$week_field"
SELECT DISTINCT a.empid FROM `employee` a LEFT JOIN `employee` b ON a.empid = b.empid WHERE a.empid != b.empid;
saramaria wrote:Dear stephenrodrics,
The MySQL is more important for php developerswithout mysql knowledge you can't developed a effective website.
For finding duplicate contents use the following sql query.
mysql> SELECT *, count(*) as n
-> FROM employee12
-> group by empid
-> HAVING n>1;
or by Using the having keyword
select firstname, lastname, count(*) cnt
group by firstname, lastname
having cnt > 1
order by cnt asc;
For more info visit..
Users browsing this forum: Google [Bot] and 1 guest