sql server 2008 - how to use distinct with where clause and inner join -


i have following query want use clause show not distinct values please me when use multiple columns after currentdate doesn't shows distinct values

select convert(varchar(10), ts.current_datetime, 101) currentdatets,ts.student_id,tc.class_name,tsi.section_name,tl.test_name tblstudentmarks ts  inner join tblclassinfo tc on tc.idx = ts.class_id  inner join tblsectioninfo tsi on tsi.idx = ts.section_id  inner join tblsubjects su on su.idx = ts.subject_id  inner join tbltestlist tl on tl.idx = ts.testtype  ts.school_id = 2 , ts.section_id = 1 , ts.class_id = 2 , ts.testtype = 1 

enter image description here

your question unclear, seems need add distinct select...

select distinct     convert(varchar(10), ts.current_datetime, 101) currentdate  tblstudentmarks ts      inner join tblclassinfo tc on     tc.idx = ts.class_id      inner join tblsectioninfo tsi on     tsi.idx = ts.section_id      inner join tblsubjects su on     su.idx = ts.subject_id      inner join tbltestlist tl on     tl.idx = ts.testtype       ts.school_id = 2 , ts.section_id = 1      , ts.class_id = 2 , ts.testtype = 1 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -