JLearner
JLearner

Reputation: 1311

Specified distinct columns only

I wish to select two distinct columns and one normal. But it seems like the error of missing right parenthesis keep coming out when i already written properly.

Here's the sample code:

Select Distinct(F.DATE, F.EXAM_TIME), T.*
From Test T, ExamRecords F
Where T.TestNo= 10
And T.TestPaper = 'Science';

Thanks for any clarification given/mistakes that i have made~

Upvotes: 0

Views: 167

Answers (2)

SAN
SAN

Reputation: 2247

DISTINCT wont work based on columns, it works on the entire row, you may want to use Group BY

Upvotes: 1

tobiasbayer
tobiasbayer

Reputation: 10389

DISTINCT can only be applied to the complete row in the query result.

Upvotes: 2

Related Questions