sql server - Display Duplicate Records (TSQL) -


i struggling sql query return duplicate rows, example:

employee_id   store_no   region 2531047     1671         e05 2544970     1254         w09 2566618     1625         e01 2566618     1635         e01 2566618     1835         e01  should like:  employee_id   store_no   region 2566618     1625         e01 2566618     1635         e01 2566618     1835         e01 

the above acheived following:

select     e.employee_id,    e.store_no,    s.region     [usicoal].[dbo].[employee_str_asgn] e right join     [usicoal].[dbo].[store] s on e.store_no = s.store_no order employee_id, region 

i have tried various options can find way remove these duplicates, not display them only... can advise if above possible?

thanks in advance, charley.

select * stuff st exists (         select 1 stuff xx         xx.employee_id = st.employee_id         group xx.employee_id         having count(*) > 1         )         ; 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -