Hi,
I have a true dailyWTF on my hands here. We have an account sign up page that dishes out new account numbers in sequential order. The problem we have is two fold. For one we had customers that already have customer IDs sign up for another customer ID. To solve this we added a "Current Customer ID" field to the form so they could enter their current customer ID, the only problem is that they are still assigned a customer ID.
The second problem is that our actual customer database in our order entry software doesn't match up with this database.
What we would like to do is select and test to see if the customer exists in the order entry software database.
The data looks like this:
Signup Table
name | id | id2
-----------------------
Bill | 1 | NULL
Jim | 2 | NULL
Sue | 3 | NULL
Bob | 4 | NULL
Author | 5 | NULL
Bill | 6 | 1
Sue | 7 | 3
OrderEntry Table
name | id
-----------------------
Bill | 1
Sue | 3
Author | 5
Query Results
name | id | id2 |id1 Exists | id2 Exists
---------------------------------------------
Bill | 1 | NULL |Yes | No
Jim | 2 | NULL |No | No
Sue | 3 | NULL |Yes | No
Bob | 4 | NULL |No | No
Author | 5 | NULL |Yes | No
Bill | 6 | 1 |No | Yes
Sue | 7 | 3 |No | Yes