Connects query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

New at query writing. I have the following two tables that I need to search
for users that are defined to the same connects. Using the following sample
tables, the query would return:

Id Default Grp: Connects:
A1234 xyzs01tr xyzs01tr

D1234 term2day
xyz01tr

Sample data:

Ids main table

Id Name Default Grp:

A1234 xyzs01tr
B2345 xyzs01tr

C1234 xtra2
D1234 xterm2day
E1234 xtra2
F

Connects table

Id: Connects:

A1234 xyzs01tr
A1234 term2day
A1234 xyz01tr
B2345 xyzs01tr
B2345 term2day
C1234 xtra4now
C1234 xtra2
D1234 term2day
D1234 xyzs01tr
D1234 xyz01tr


Thanks in advance for any assistance provided.
 
C said:
Help.. Any suggestions please?


Sorry, but I can not find any logical connection between
your sample table contents and the desired results.

You can easily get all the connects for each ID by using:

SELECT Ids.ID, Connects.Connects
FROM Ids INNER JOIN Connects
ON Ids.ID = Connects.ID

But I have no idea how you expect to exclude most of the
Connects values from the result.
 
Marshall, I did state that I was a newbie. :-)

Anyway, I guess I was hoping that we could essentially read each id, compare
the number of connects and locate those with the same. many to one, several
times if you will.
 
C said:
Marshall, I did state that I was a newbie. :-)

Anyway, I guess I was hoping that we could essentially read each id, compare
the number of connects and locate those with the same. many to one, several
times if you will.


If you want all the many to one values, the I think the
query I posted will do that. Give it a try and see how
close it comes to what you want it to do.
 
Marshall,
tried it, but no success. :-) Result was empty, although I know we have
similar records.
 
C said:
tried it, but no success. :-) Result was empty, although I know we have
similar records.


Unless the names of the tables or fields are wrong, I can't
see how such a simple query could return no records. Double
check the names of everything.
 
Back
Top