[drupal-devel] couple of SQL questions

Gordon Heydon gordon at heydon.com.au
Mon Oct 10 13:42:14 UTC 2005


Hi,

I have a couple of issues that I have been playing with for a project
and can't quite get my head around it from a SQL POV.

Is it possible to list all the rows in a table where one column has more
than one occurrence of the same value.

In this can I am storing the ip address of some submitted data, and I
need to check to see if they have submitted more than 1 row. I don't
care about the ones with a single occurance, but I need to know about
the ones that appear more that one.

My second question is that.

I have 2 tables, one is a teams table which has a list of entered teams.
The other table is a list of members for each team. One of the columns
is the name of the member. What I would like to do is create a select
from the team table which has a single column with a comma separated
list of members in a single field. This means I could sort and use it as
a method of detecting entries of multiple teams with the same members.

Or if anyone has a better ideas on how to detect duplicate entries would
be most appreciated.

Thanks in advance.
Gordon.





More information about the drupal-devel mailing list