Hi Friends,
There is a table with two columns containing a long account number and a short account number. like this:
LongAcctNum ShortAcctNum
A00146000 A00146
A00146000 1000146000
Q78886001 Q78886
00351250246 351250246
Each long account number should be having one short account number. But some have two. If I have to pick out such long acct. numbers, what kind of query should I write? Can I use a self-join on this table, something like:
select LongAcctNum, ShortAcctNum from table1 t1 where t1.LongAcctNum = t1.LongAcctNum and t1.ShortAcctNum != t1.ShortAcctNum.
I tried this way; it doesn't work. Can my friends here please correct me?
Thanks!