Jump to content

[SOLVED] WHERE ?


Clinton

Recommended Posts

Let's say I've got three fields that keep track of a persons skills.

 

These are Bobs skills...

 

Field 1 is his primary skill, say a Carpenter.

Field 2 is his secondary skill, say a Hair Dresser.

Field 3 is his tertiary skill, say a Window Washer.

 

These are Joes skills...

 

Field 1 is his primary skill, say a Hair Dresser.

Field 2 is his secondary skill, say a Carpenter.

Field 3 is his tertiary skill, say a Window Washer.

 

Now lets say I wanted to pull up all the people who are qualified to be a carpenter. How do I do this?

 

Right now I've got:

 

SELECT * FROM thelist WHERE pskill = 'carpentry'

 

But this only lists the ones who have the primary skill of carpentry.

 

If I do:

 

SELECT * FROM thelist WHERE pskill = 'carpentry' AND sskill = 'carpentry' 

 

then it leaves out anybody who just has the primary skill (or secondary if I include the third).

 

How do I make it so it finds all carpenters in any of those three fields without excluding everyone if one doesn't have it?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.