假设我有这样的第一张桌子
分支表
|name |description|
|123456ABC|FOO |
|553646DEF|FO2 |
Run Code Online (Sandbox Code Playgroud)
和第二张桌子这样
余额表
|name|description|
|ABC |oof |
|DEF |2of |
Run Code Online (Sandbox Code Playgroud)
我想查询余额表,其中每一行都包含分支表中的名称。例如,分支表中的“123456ABC”,我想从余额表中获取“ABC”行
我怎么能做到这一点?到目前为止,我已经尝试过这个查询,但没有运气
select * from Balance
where name like (
SELECT `name` FROM Branch
);
Run Code Online (Sandbox Code Playgroud)
有什么建议吗?
我正在尝试使用curl. 这是我尝试过的。
首先,获取最后一个管道 ID:
curl -v -H "Content-Type: application/json" -H "PRIVATE-TOKEN: <my-token-here>" https://<project>/api/v4/projects/<project>/pipelines?per_page=1&page=1
Run Code Online (Sandbox Code Playgroud)
接下来,根据之前刚刚获取的管道 id 获取作业 id:
curl -sS --header "PRIVATE-TOKEN: <my-token-here>" "https://[redacted,host]/api/v4/projects/[redacted,project]/pipelines/<pipeline-id>/jobs" | jq '.[] | select(.name == "build-assets" and .status == "success" and .artifacts_file != null) | .id'
Run Code Online (Sandbox Code Playgroud)
最后,build.zip根据作业 ID获取工件:
curl -sS --header "PRIVATE-TOKEN: <my-token-here>" "https://[redacted,host]/api/v4/projects/[redacted, project]/jobs/<JOB_ID>/artifacts" > build.zip
Run Code Online (Sandbox Code Playgroud)
上面的这些步骤确实有效,但我必须点击三个端点(并为每个步骤处理 JSON 响应)。
我也读GitLab的文档,这有一个单一的可用于该端点。所以我也试过这个:
curl -sS --header "PRIVATE-TOKEN: <my-token-here>" "https://<url>/<namespace>/<project>/-/jobs/artifacts/<refs>/download?job=<job_name>"
Run Code Online (Sandbox Code Playgroud)
但这总是将我重定向到登录页面,说:
curl -v -H "Content-Type: application/json" -H "PRIVATE-TOKEN: <my-token-here>" https://<project>/api/v4/projects/<project>/pipelines?per_page=1&page=1
Run Code Online (Sandbox Code Playgroud)
有没有更简单的方法来完成这项任务?或者如何正确使用上述文档中描述的端点?
我正在尝试使用Bootstrap创建一个简单的模态弹出窗口.我从http://getbootstrap.com/javascript/#modals获取了示例,我的代码看起来像这样..
<html>
<head>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/bootstrap-modal.js"></script>
<link rel="stylesheet" href="css/bootstrap.css" />
</head>
<body>
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Launch demo modal
</button>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
当我在我的浏览器上运行并单击按钮时,弹出窗口仅在几毫秒内显示然后再次关闭..如何防止弹出窗口关闭?
curl ×1
database ×1
gitlab ×1
gitlab-ci ×1
javascript ×1
jquery ×1
modal-dialog ×1
postgresql ×1
select ×1
sql ×1