Left outer join, group by having?I'm looking to hire someone for an hour or two to help me touch up a few SQL queries I've written for work. You'd have to meet me due to the login issues, but I'd be willing to pay you for your time.
Where are you located?
If it's standard T-SQL, the DBMS doesn't really matter. I know each has their own eccentricities, but it's still just SQL ATEOTD.
-John
Towson, but willing to travel to get this shit fixed.
If it's not executing or you can explain what you want it to do, send it to me, I'll take a look see.
-John
Basically, the problem is it's returning two entries per person, one is their major, and one their minor, when it's only supposed to return 1 per person.
I've tried enabling the unique check box, but I'm pretty sure it's an issue with the fact that their are two records for each student.
That's why you might need actually see how it's configured, which I'd have to be there to let you log in.
I would be happy to drive though.
Distinct could work as long as major and minor are not in the same field and present in the select statement. Distinct is the way to go. You just have to make sure you don't include any fields in your select statement that could have different values for the same personOK, have you tried using the DISTINCT keyword in your SQL statement?
-John
Distinct could work as long as major and minor are not in the same field and present in the select statement. Distinct is the way to go. You just have to make sure you don't include any fields in your select statement that could have different values for the same person
Sent from my XT1254 using Tapatalk
Also correct if he is using any aggregate functions. I didn't see that in his statement. Really need to see the actual SQL scriptTrue.
Also, IIRC, every other field will have to be in an aggregate (in the GROUP BY clause or MAX(), MIN(), etc.)
-John