Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL field name iteration

Status
Not open for further replies.

Thomas001

Programmer
Jun 24, 2004
29
US
What if I'm trying to retreive multiple field names by matching a column they own.

like:

*E404
Joe

*E403
Joe

*E402
Joe

*E401
Jim


If I did a search for Joe, I would get E404, E403, E402, E401..


Am I explaining this well enough?
 
A bit more verbose description would help.

However, from what I read in your post it seems that the table in that case is skewed. What should be column content is column names.
 
Yes indeed, it is skewed. There isn't anything I can do about it however because the other programmer already has his code sorting it out this way but with Perl.

Basicly I'm trying to return the field name if the data within that column ='s the variable I set.
 
My first thought only sees a solution that uses SQL employing either an intricate 'OR' construct in the WHERE clause to limit to recors containing 'Joe' or a full-text index.
The second part then would be a while loop that iterates through the records - retrieved as associative array - and return the keys for fields where the value matches the search string.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top