473,385 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

FIND_IN_SET only returns first record

If I've got:

Table: users
ID USERNAME EMAIL
1 syeargin st*****@yeargin.com
2 bwalkerton be**********@aol.com
3 rrandall rr@aol.com
....

Table: committees
ID COMM_NAME MEMBERS
1 legislative syeargin, bwalkerton
2 diversity syeargin, rrandall
3 executive syeargin, rrandall, bwalkerton
....
How can I write a query that follows the logic: Return all 'EMAIL'
values where 'COMMITTEE' is "legilsative"?
I've tried

SELECT COMM_NAME, EMAIL
FROM users INNER JOIN committees ON FIND_IN_SET(users.USERNAME,
members)
WHERE COMM_NAME = "legislative"
ORDER BY USERNAME ASC
But it only returns:

USERNAME EMAIL
syeargin st*****@yeargin.com

Or whatever the first value is. Any ideas?
---

Stephen Yeargin
st*************@gmail.com
Jul 20 '05 #1
0 1311

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ebobnar | last post by:
Since find_in_set only searches by a single string, like: find_in_set('a', 'a,b,c,d'); is there a way to achieve functionality like you would if find_in_set could search by multiple strings,...
0
by: R U B'n | last post by:
Hi everyone, I have to make a (case-insensitive) search from a form with only one search string, e.g. "Doe Peters english California", which will search in several fields of my table for each...
0
by: Stephen Yeargin | last post by:
If I've got: Table: users ID USERNAME EMAIL 1 syeargin stephen@yeargin.com 2 bwalkerton benwalkerton@aol.com 3 rrandall rr@aol.com .... Table: committees
6
by: BlueDragon | last post by:
Grrr! I'm trying to run a script: print 'Declaring cursor' declare cInv cursor forward_only static for select distinct inv.company, inv.contact, inv.address1, inv.city,
6
by: Bob Hairgrove | last post by:
We are having problems retrieving diagnostic information from a DB2 database (server is 7.1.x, client is 8.1). The SQLGetDiagRec() function, when called on a valid DB2 statement handle, always...
1
by: db | last post by:
I am trying to build a db in Access2000 that will allow me to calculate month end returns on investments. I am about to try VBA for the first time, but wonder if I can do what I want by using...
4
by: kathy | last post by:
Working in a form, I have an Iif statement where if a date is not filled in, another field will show as a blank. If the date IS filled in, the 2nd field will show its actual value. The following...
0
by: Solution Seeker | last post by:
Hi, We are using vb.net for creating a Windows Application. We are using layered approach, with a UI layer, Logic, Db Access layer etc. we are encountering a peculiar problem when we try to...
7
by: Jimakos Bilakis | last post by:
Hi guys! I'm using the C++ Builder 6 Enterprise Edition where I create some tables in Paradox and with the help of a structure i pass my data from the form (Edit boxes) to the Paradox table with...
1
by: js | last post by:
I am using the following C# code and T-SQL to get result object from a SQL Server database. When my application runs, the ExecuteScalar returns "10/24/2006 2:00:00 PM" if inserting a duplicated...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.