How do you access the value of an SQL count () query in a Java program

前端 未结 7 1145
梦毁少年i
梦毁少年i 2021-02-01 00:54

I want to get to the value I am finding using the COUNT command of SQL. Normally I enter the column name I want to access into the getInt() getString() method, what do I do in t

7条回答
  •  -上瘾入骨i
    2021-02-01 01:17

    I would expect this query to work with your program:

    "SELECT COUNT(*) AS count FROM "+lastTempTable+")"

    (You need to alias the column, not the table)

提交回复
热议问题