我试图按升序运行此查询:
SELECT title,project_index
FROM projectdetail
WHERE project_index BETWEEN 1 AND 6
ORDER BY title, project_index ASC;
Run Code Online (Sandbox Code Playgroud)
我需要按升序排列两列,但上面的查询会返回只有一列的结果ASC.
我在数据库中有以下字符串
**final test project - test decorations**
Run Code Online (Sandbox Code Playgroud)
我想用破折号(更换空格的-字符).这是我到目前为止:
tit1 = rs.getString("title");
tit1 = tit1.replaceAll("\\s{1}", "-");
Run Code Online (Sandbox Code Playgroud)
输出看起来像这样
**final-test-project---test-decorations**
**shadow-of-the-test----test**
Run Code Online (Sandbox Code Playgroud)
但我想要这样的输出
**final-test-project-test-decorations**
**shadow-of-the-test-test**
Run Code Online (Sandbox Code Playgroud)
如何使替换忽略用空格包围的单个短划线?