I'm learning SPARQL for Wikidata queries, and I'm trying to figure out how to query coaches that have worked at one point for two sport teams.
I've achieved how to query the ones that worked for only one team:
SELECT ?coach ?coachLabel
WHERE {
wd:Q7156 p:P286 ?team1.
?team1 ps:P286 ?coach.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".}
}
but I don't know how to intersect it with the results for a ?team2
.
How can I solve this?