I have an SQL query that I am running. What I wanted to know is that there is a way to select rows in a table, where the value inside one of these columns is different? When I use a separate function, it returns all the individual rows, so ...
select distinct teacher from class etc.
This works fine, but I select multiple columns, so ...
select distinct teacher, student etc.
but I don’t want to extract individual lines, I need different lines in which the teacher is different. So this query is likely to return the same teacher name several times because the value for the student is different, but I would like to return strings in which the teachers are different from each other, even if it means returning the teacher and one student name (because I do not need all students).
I hope that what I'm trying to ask is clear, but is it possible to use a separate function in the same column even when selecting multiple columns, or is there any other solution to this problem? Thank.
, . , "" . .., , . ( 10) . , , . , . , , , , , . . , , , .
Col A Col B Col C Col D
a b c d
a c d b
b a a c
b c c c
, , . , Col A . ?