Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
anishap
Yak Posting Veteran
61 Posts |
Posted - 2011-05-11 : 14:57:21
|
I have a table with fldtypes,date. I want to select rows of all employees that only have fldtype = 'MMR' and is listed more than once.I tried the below query but its not workingselect e.fldlname,e.fldfname,p.fldtype from employee e, physlog pwhere e.fldrec_num = p.fldemployee ande.fldcomp = 'MED' and p.fldtype NOT IN ('110','110A','MEA','HEPA','COLOR') order by e.fldlnameany help on this..please let me know |
|
latch
Yak Posting Veteran
62 Posts |
Posted - 2011-05-11 : 17:30:40
|
For more than once:You can use Group by with having count(fldtype)>1 and with where fldtype='MMR'The information you supplied is not sufficient to answer, can you provide more information about the tables and values it has.Thanks |
 |
|
mmarovic
Aged Yak Warrior
518 Posts |
Posted - 2011-05-11 : 17:50:17
|
The query you posted does not seem to relate to the question you asked. Maybe you copied the wrong query?MirkoMy blog: http://mirko-marovic-eng.blogspot.com/ |
 |
|
|
|
|