sql = "select * from studentlist where firstname like '%" & Transaction.SEARCHSTUDENT.Text & "%' or studentnum like '%" & Transaction.SEARCHSTUDENT.Text & "%' exists(select * from studentlist where status = 'Vacant')"
帮助我修复我的查询PLS
请考虑使用参数绑定,而不是直接在SQL字符串中连接参数
也就是说,你有一个错别字:
"%' exists(...
应该是(注意缺少的and
):
"%' and exists(