我有这样的字符串:String sql = "SELECT COL1, COL2, COL3 FROM SCHEMA.TABLE";
现在我需要从字符串中获取这个值:SCHEMA.TABLE
并且这个值总是在变化。而且整个 SQL 总是在变化。
我将如何实现这一目标?
不知道如何使用不同的值进行操作?这个值总是在后面FROM
,SQL 也可能在FROM
( ORDER BY, GROUP BY...
)后面有其他值
示例 SQL:
`SELECT ZGAR.ZGAR_ID, JARTI.ARTI_NAME, JZGAR.ZGAR_NAME, ZGAR.KAZG_ID, ZGAR.KZPO_ID, JZGAR.ZGAR_DESC FROM NETZGP.ZGANJEARTIKEL ZGAR LEFT JOIN NETZGP.J_ARTI JZGAR ON ZGAR.ZGAR_ID = JZGAR.ZGAR_ID LEFT JOIN NETZGP.J_ARTIKEL JARTI ON ZGAR.ARTI_ID = JARTI.ARTI_ID AND JZGAR.JEZI_ID = JARTI.JEZI_ID WHERE ZGAR.ARTI_ID = 1 AND JZGAR.JEZI_ID = 1 WITH UR`