Re: find_in_set syntax

2001-12-12 Thread Etienne Marcotte

mysql create table gd_records(
- id int unsigned auto_increment,
- res_skills
set(skills1,skills2,skills3,skills4,skills5,skills6),
- res_skills_ma
set(skills_ma1,skills_ma2,skills_ma3,skills_ma4,skills_ma5,skills_ma6),
- primary key(id));
Query OK, 0 rows affected (0.00 sec)

[Enter some values]

mysql select * from gd_records;
++-++
| id | res_skills  |
res_skills_ma  |
++-++
|  1 | skills1,skills2 |
skills_ma4,skills_ma5  |
|  2 | skills2,skills4 |
skills_ma2,skills_ma3  |
|  3 | skills1,skills3 |
skills_ma3,skills_ma6  |
|  4 | skills4,skills5 |
skills_ma2,skills_ma6  |
|  5 | skills1,skills4 |
skills_ma2,skills_ma3  |
|  6 | skills1,skills2,skills3 |
skills_ma1,skills_ma3,skills_ma5  |
|  7 | skills3,skills4,skills5,skills6 |
skills_ma1,skills_ma2,skills_ma3,skills_ma5,skills_ma6 |
|  8 | skills1,skills3,skills4,skills6 |
skills_ma2,skills_ma4,skills_ma5,skills_ma6|
++-++
8 rows in set (0.00 sec)

mysql SELECT  FROM gd_records WHERE FIND_IN_SET(skills3,res_skills)
AND FIND_IN_SET(skills_ma3,res_skills_ma);
++-++
| id | res_skills  |
res_skills_ma  |
++-++
|  3 | skills1,skills3 |
skills_ma3,skills_ma6  |
|  6 | skills1,skills2,skills3 |
skills_ma1,skills_ma3,skills_ma5  |
|  7 | skills3,skills4,skills5,skills6 |
skills_ma1,skills_ma2,skills_ma3,skills_ma5,skills_ma6 |
++-++
3 rows in set (0.00 sec)

Tadam

you can't use the WHERE col_name  value ehrne you have more than one
SET afaik

HTH,
Etienne

Wiliam Stephens wrote:
 
 At 17:40 11/12/01, you wrote:
 Can you provide your table description?
 
 You have two set colums? One called res_skills and one called
 res_skills_ma ?
 
 Yeah, Both are SET columns.
 
 Wil

-- 
Etienne Marcotte
Specifications Management - Quality Control
Imperial Tobacco Ltd. - Montreal (Qc) Canada
514.932.6161 x.4001

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: find_in_set syntax

2001-12-12 Thread Wiliam Stephens

At 17:40 11/12/01, you wrote:
Can you provide your table description?

You have two set colums? One called res_skills and one called
res_skills_ma ?

Yeah, Both are SET columns.

Wil


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Re: find_in_set syntax

2001-12-11 Thread Wiliam Stephens

At 17:23 11/12/01, you wrote:
Your message cannot be posted because it appears to be either spam or
simply off topic to our filter. To bypass the filter you must include
one of the following words in your message:

database,sql,query,table

If you just reply to this message, and include the entire text of it in the
reply, your reply will go through. However, you should
first review the text of the message to make sure it has something to do
with MySQL. Just typing the word MySQL once will be sufficient, for example.

You have written the following:


  SLECT * FROM gd_records WHERE res_skills  3 AND res_skills_ma  3;

That should of been SELECT. Typo, sorry. Still problem persisting, though.

How do others overcome this?

Wil


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: find_in_set syntax

2001-12-11 Thread Etienne Marcotte

Can you provide your table description?

You have two set colums? One called res_skills and one called
res_skills_ma ?

Etienne

Wiliam Stephens wrote:
 
 Hi
 
 Can anyone tell me what is wrong with the MySQL FIND_IN_SET function? Well,
 I'm using the following:
 
  ELECT * FROM gd_records WHERE res_skills  3 AND res_skills_ma  3;
 
 And it returns the most weird results. It completely ignores the AND
 statement, and returns results even if the second statement is true or not?
 
 Why is this?
 
 Is this a major bug or is there a problem with my query?
 
 Thanks
 
 Wiliam Stephens
 
 Web Developer
 http://www.fbagroup.co.uk
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-- 
Etienne Marcotte
Specifications Management - Quality Control
Imperial Tobacco Ltd. - Montreal (Qc) Canada
514.932.6161 x.4001

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php