Re: AW: Select one valuebut not the other

2015-04-29 Thread Olivier Nicole
t; Geschäftsführer: Dr. Bernd Reifenhäuser, Dr. Alexander Ebbes > Handelsregister: HRB 6870 - Amtsgericht Mainz > > > > > -Ursprüngliche Nachricht- > Von: Olivier Nicole [mailto:olivier.nic...@cs.ait.ac.th] > Gesendet: Mittwoch, 29. April 2015 07:21 > An: mog...@fumlersoft.d

Re: Select one valuebut not the other

2015-04-29 Thread Olivier Nicole
Lucio, >> I have a table where each record is made of one item_number and one >> data_value. > You do not have any other column ? In particular you do not have any > unique key record identifier ? All my tables have a column with a record > sequence number "seq int NOT NULL AUTO_INCREMENT" whic

Re: Select one valuebut not the other

2015-04-29 Thread Olivier Nicole
Thank you, > SELECT * FROM test > WHERE item_number in (SELECT item_number FROM test where data_value=1) > AND item_number not in (SELECT item_number FROM test where data_value = 2); That did it. Olivier > On Wed, April 29, 2015 07:20, Olivier Nicole wrote: >>> SELECT * FROM table WHERE item_

Re: Select one valuebut not the other

2015-04-29 Thread Lucio Chiappetti
On Wed, 29 Apr 2015, Olivier Nicole wrote: I have a table where each record is made of one item_number and one data_value. You do not have any other column ? In particular you do not have any unique key record identifier ? All my tables have a column with a record sequence number "seq int NO

AW: Select one valuebut not the other

2015-04-29 Thread Axel Diehl | GIP
Nicole [mailto:olivier.nic...@cs.ait.ac.th] Gesendet: Mittwoch, 29. April 2015 07:21 An: mog...@fumlersoft.dk Cc: mysql@lists.mysql.com Betreff: Re: Select one valuebut not the other > SELECT * FROM table WHERE item_number=1; Sorry if my question was not clear: what I am looking for is: SELECT * FROM ta

Re: Select one valuebut not the other

2015-04-29 Thread Mogens Melander
Right, Take a look at this one then: insert into test(item_number,data_value) values(1,1),(1,2),(1,3) ,(2,1),(2,3) ,(3,1),(3,2),(3,3) ,(4,1),(4,3); SELECT * FROM test WHERE item_number in (SELECT item_number FROM test where data_value=1) AND item_number not in (SELECT item_number FROM test where

Re: Select one valuebut not the other

2015-04-28 Thread Olivier Nicole
> SELECT * FROM table WHERE item_number=1; Sorry if my question was not clear: what I am looking for is: SELECT * FROM table WHERE data_value=1 AND "there is not any reccord with the same item_number and data_value=2" Olivier > > On Wed, April 29, 2015 06:30, Olivier Nicole wrote: >> Hi, >> >>

Re: Select one valuebut not the other

2015-04-28 Thread Mogens Melander
SELECT * FROM table WHERE item_number=1; On Wed, April 29, 2015 06:30, Olivier Nicole wrote: > Hi, > > I am sure that it is feasible with MySQl, and I am sure that's a newbie > question, but my SQL skills are limited... > > I have a table where each record is made of one item_number and one > data

Select one valuebut not the other

2015-04-28 Thread Olivier Nicole
Hi, I am sure that it is feasible with MySQl, and I am sure that's a newbie question, but my SQL skills are limited... I have a table where each record is made of one item_number and one data_value. If one item has several values, there are several records with the same item_number and a differe