oracle ZQX_XSM_WX_PC_RECORD表biao_qian字段内容用逗号(,)分割,并转换多条数据 sql怎么写
时间: 2024-11-27 07:10:31 浏览: 19
Oracle中的ZQX_XSM_WX_PC_RECORD表中,如果`biao_qian`字段的内容确实是以逗号分隔的值列表,你可以使用`REGEXP_SUBSTR()`函数结合`CONNECT BY`循环来提取并显示多条数据。假设你想获取每一条记录的第一部分,直到遇到下一个逗号为止,可以尝试以下SQL:
```sql
SELECT level,
REGEXP_SUBSTR(biao_qian, '[^,]+', 1, level) AS value
FROM (
SELECT biao_qian,
LEVEL + LENGTH(MAX(SYS_CONNECT_BY_PATH(biao_qian, ', '))) AS start
FROM ZQX_XSM_WX_PC_RECORD
WHERE biao_qian IS NOT NULL
START WITH LENGTH(biao_qian) > 0
CONNECT BY prior biao_qian = ',' || biao_qian
)
WHERE ROWNUM <= 1
ORDER BY start;
```
这个查询首先通过`SYS_CONNECT_BY_PATH()`生成了每个值的完整路径,然后从该路径中找到每个值的起始位置。`REGEXP_SUBSTR()`则用于从指定位置开始提取每个值。
相关问题
String jsonInput = "{"Appkey":"mEwead5ZQx0psM6b","Sign":"9d5cd39aab1adb6837e044e2eed0dd82","Timestamp":Timestamp,"TargetNodeId":"gdwalzz","TargetDatabaseId":"WalzzPaperERP","QueryID":0,"SQLCommand":"select * from Users"}";,mEwead5ZQx0psM6b,9d5cd39aab1adb6837e044e2eed0dd82等等几个,替换成变量提供给我,变量就用Appkey,Sign以此类推
以下是使用变量替换的代码示例:
```java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class HttpRequestUtil {
public static String sendPostRequest(String url, String appKey, String sign, long timestamp, String targetNodeId, String targetDatabaseId, int queryId, String sqlCommand) throws IOException {
URL requestUrl = new URL(url);
HttpURLConnection connection = (HttpURLConnection) requestUrl.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("cache-control", "no-cache");
connection.setRequestProperty("Postman-Token", "286f9b9a-e6ee-4e83-b37b-aae5d6ea7a5e");
connection.setDoOutput(true);
String jsonInput = String.format("{\"Appkey\":\"%s\",\"Sign\":\"%s\",\"Timestamp\":%d,\"TargetNodeId\":\"%s\",\"TargetDatabaseId\":\"%s\",\"QueryID\":%d,\"SQLCommand\":\"%s\"}",
appKey, sign, timestamp, targetNodeId, targetDatabaseId, queryId, sqlCommand);
try (OutputStream outputStream = connection.getOutputStream()) {
byte[] input = jsonInput.getBytes("utf-8");
outputStream.write(input, 0, input.length);
}
int responseCode = connection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
StringBuilder response = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
response.append(line);
}
reader.close();
return response.toString();
} else {
throw new IOException("HTTP request failed with code: " + responseCode);
}
}
public static void main(String[] args) {
try {
String url = "http://www.walzz.com/api/walzzerpapi.asq";
String appKey = "mEwead5ZQx0psM6b";
String sign = "9d5cd39aab1adb6837e044e2eed0dd82";
long timestamp = 1690161912433L;
String targetNodeId = "gdwalzz";
String targetDatabaseId = "WalzzPaperERP";
int queryId = 0;
String sqlCommand = "select * from Users";
String response = sendPostRequest(url, appKey, sign, timestamp, targetNodeId, targetDatabaseId, queryId, sqlCommand);
System.out.println(response);
} catch (IOException e) {
e.printStackTrace();
}
}
}
```
在这个示例中,我添加了新的参数并将它们传递给 `sendPostRequest` 方法。你可以使用这些参数来动态构建 JSON 输入字符串。确保将这些变量替换为你实际的值。
matlab语义分割 图像增强
根据引用和引用,在Matlab中进行图像语义分割的图像增强主要包括旋转、对称上下左右翻转和缩放等操作。数据增强的主要目的是通过生成一系列变化后的图像,扩充训练数据集,提高模型的鲁棒性和性能。具体来说,可以使用函数`doAugmentate`来实现图像增强,在该函数中,可以通过修改参数`imgnum`来控制生成的图像数量。
此外,引用提到数据增强可以改进不同计算机视觉任务的模型结果,包括图像分类和图像语义分割。因此,对于Matlab语义分割任务,采用图像增强可以提高模型的性能和准确度。
总结起来,Matlab语义分割的图像增强方法主要包括旋转、对称上下左右翻转和缩放等操作,通过增加数据量和多样性来提高模型性能和鲁棒性。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [语义分割 图像增强(数据扩充)教程](https://blog.csdn.net/zqx951102/article/details/109543140)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [WB color gainer:可以提高图像分类和语义分割精度的WB增强器(ICCV 2019)-matlab开发](https://download.csdn.net/download/weixin_38589795/19266438)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文