I have a column in a table: ID - this column can have a value of '123456' but can also have value '123456x'.
I need to return all the numbers where there is an 'x' and the same number but without an 'x' doesn't exist. So if '123456' and '123456x' both exist I don't get a result. If '345678' exists and '345678x' does not exist then I get a result.
I'm sure this must be simple using a subquery and likes but it's wrecking my brain trying to construct the query. Please help!
Thanks
45678
is exist two times? Those need to come in the final result?