2
I saw in a SQL book the following query:
select T.course_id from course as T where unique (select R.course_id from section as R where T.course_id = R.course_id and R.year = 2009)
I am unable to apply this query to SQL Server, which I put in place to replace Unique and return to subquery without duplicate tuples?
where unique
is a syntax ofOracle
, in theSQLServer
usedistict
– Ricardo Pontual
But distinct doesn’t work after Where, only in select, so I don’t know how to apply this with a sub-query. I even put distinct in select but it doesn’t work.
– Rafael Costa
yes, the distinct is used in the fields of
select
. See my answers– Ricardo Pontual