Hi I have a file in the following format. Basically the file contains tablename and their aliases:
TABLE1
TABLE1 A
TABLE2
TABLE2 B
TABLE3
TABLE4
TABLE4 C
TABLE4
Upon formatting an sql statement I am getting such output.
Problem: Whenever a tablename appears with alias, it has repeated entries in the file. One without alias, and one with alias. I want to remove the first occurance of the tablename (without aliases). but there might be some entries with tablename without any alias, don't wanna delete those. also there can be a repetition of same table, and one could be with alias one could be without alias.
Solution: Basically just want to delete the line which preceeds with tablename with alias. so the output should be like:
TABLE1 A
TABLE2 B
TABLE3
TABLE4 C
TABLE4
Hope I am clear enough.
Your help would be much appreciated. Thanks.