-1

I have database with 3 columns: id, numbers1 and numbers2.

I am doing a query like this:

select id from numbers where numbers.numbers1 = numbers.numbers2;

And I am getting a result of something in the id column.

Assuming I have 1,2,3,4,5 in the id column and I am getting as a result 1,2,3 how do i show what have left from the column? I mean how do I show in the result 4,5? and not the 1,2,3 that I got in the result?

Danny
  • 121
  • 1
  • 2
  • 10
  • 3
    Too hard to figure this out `select id from numbers where numbers.numbers1 <> numbers.numbers2;` ? What can be opposite to `EQUAL`? May be `NOT EQUAL`? – Giorgi Nakeuri May 28 '16 at 09:43
  • Hi, no it doesn't help me because there are a lot of values in those columns and i am getting a lot more answers from what i need. actually i need to do this query but instead of getting the original result i need to get "the entire column (id) less then the original result. here is 1,2,3,4,5 less then 1,2,3 (the result of the query) so the result will be 4,5. – Danny May 28 '16 at 09:47
  • @Danny, your last comment does not make sense to me. – Giorgi Nakeuri May 28 '16 at 09:49
  • sorry for the ignorance, i am little bit new in this field. what didn't you understand? i have an `id` column which i am getting in the result `1,2,3` for the `id` column. what i want to do is not showing in the result the `1,2,3`. i want to show the `4,5` meaning the entire column `id` less the original `1,2,3` result. – Danny May 28 '16 at 10:02

1 Answers1

1

The simplest would be to just query the opposite - instead of =, using !=:

SELECT id
FROM   numbers
WHERE  numbers.numbers1 != numbers.numbers2;
Mureinik
  • 297,002
  • 52
  • 306
  • 350