sql - Locating records in a table where one of its field has more than one corresponding field -


i hope title not confusing. having trouble querying table in access. going use example of trying do. trying locate records 1 of field has more 1 corresponding field. example in mini table created below want query id_number field return id number 3 because id number 3 has 2 corresponding id code, efg , hij. table have 1 id number each id code. if there is more 1 id code each id number want see record return in result.

id_number   id_code     adress  1            abc        123  2            cde        567   *3           efg        897 *3           efg        589  $3           hij        215 5            lmp        532  6            mno        895 7            pqr        875 8            stu        312  

thank quick reply. should had been more specific because thought original info had been enough didn't think address variable, sorry not mentioning earlier. issue @ hand id number , id code can have duplicate if have different address ones marked *. there cannot duplicate of id number different id code , address. there way query duplicate $ mark?

or of want 1 query give this:

select * ( select *, count(fieldname) count tablename  group fieldname ) t1 t1.count > 1; 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -