Hi,
maybe my problem has a very simple solution, but I'm going crazy to find a way to do that.
I have a single table that looks like this:

Number | Value (both string and numeric)

123 | foobar
123 | 23846
123 | foobar
345 | 34523
345 | 64734
678 | foobar
678 | foobar
678 | foobar

From such table I should extract all the "Number"s that have as Value both "foobar" and a number ONLY (like the "123" example in which Value is both = "foobar" and <> "foobar)).
Of course each line is a different record.

Can you help me to solve such puzzle?
Thank you in advance!

i think this is what you are meaning

select number, value from tablename where
number in (select number from tablename where value='foobar')

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.