This demo version of Java SQL Parser does something like this:
SQL input:
SELECT A as A_Alias, B AS B_Alias FROM TABLE_X
If you need to remove the second column "B AS B_Alias" from the selection list, just do something like this:
columns.removeResultColumn(1);
then you will get this new SQL (it was deleted automatically):
SELECT A as A_Alias FROM TABLE_X
This demo also shows how to replace a column, Add criteria (where clause), Add order order, etc.
James wang
source share