Timon, is this ...

SELECT cds.softid,nameofcd,nameofsoftware
FROM cds INNER JOIN software USING (softid)
WHERE nameofcd LIKE '%test%' OR nameofsoftware LIKE '%test%';
+--------+------------+----------------+
| softid | nameofcd   | nameofsoftware |
+--------+------------+----------------+
|      1 | test cd 1  | test software  |
|      1 | test cd 1  | software       |
|      1 | test cd 1  | software       |
|      2 | utils cd 1 | test           |
+--------+------------+----------------+

what you mean?

PB
  ----- Original Message -----
  From: Timon Berkowitz
  To: [EMAIL PROTECTED]
  Sent: Tuesday, March 30, 2004 12:34 PM
  Subject: Re: Difficult query and am kinda stuck how to continue can
someone help?


  Hi there,


  I have tried that query it works, but not good enough....

  When you add in Table2 another row with softid 1 and without the string
'test' in it like this :

  softid    | nameofcd
  1            test cd 1
  2            utils cd 1
  3            test cd 2
  4            backup

  id        | softid    | nameofsoftware
  1           1            test software
  2           1            software
  3           2            software
  4           2            software
  5           1            software

  the query you used will give the following result

  softid   nameofcd   nameofsoftware
  1         test cd 1
  1         test cd 1
  1         test cd 1    test software
  3         test cd 2

  Thats incorrect because I want to see only
  - all cds that matches the string 'test'
  - all pieces of software that matches the string 'test'

  So the result has to be like this

  softid   nameofcd   nameofsoftware
  1         test cd 1
  1         test cd 1    test software
  3         test cd 2

  I hope I have made myself a little bit more clear....

  By the way, Thank you for the quick response!

  Kind regards,

  Timon Berkowitz
  The Netherlands

Reply via email to