检查表中是否有重复项

Hello I have been working on an sql code I found online that said that it check if there duplicates online.

What I want to do is that it checks whether if a value has a duplicate in the table it is inserting then I need to return a booleon in PHP but I am having a problem in MYSQL code. I have this code I have found online:

SELECT schedday,schedtime COUNT(schedday, schedtime) as count
FROM scstock
GROUP BY schedday, schedtime
HAVING COUNT(schedday, schedtime) > 1

But I am having this error enter image description here

Then I tried to modify it to this which is I wanted to accomplish

SELECT schedday,schedtime COUNT(schedday, schedtime) as count
FROM scstock
WHERE schedday = 'M/T' AND schedtime = '7:00-9:00/7:00-9:00'
HAVING count > 1

But this appears enter image description here

Can you help me?

Try this below query for your result

SELECT schedday,schedtime, COUNT(*) as count FROM scstock GROUP BY schedday, schedtime HAVING count > 1

you have syntax error you should put an "," after schedtime

SELECT schedday,schedtime , COUNT(schedday, schedtime) as count
FROM scstock
GROUP BY schedday, schedtime
HAVING count > 1