我是SQL的新手,我不理解这种语言的工作方式 我有一个代码:
if (select Zarobki from PRACOWNICY) < 3000
update PRACOWNICY set Zarobki = Zarobki * 2
else
update PRACOWNICY set Zarobki = Zarobki / 2
如何比较表格中的多个值?我认为选择工作就像循环语句一样
答案 0 :(得分:2)
您可以写:
<script>
$(document).ready(function() {
$('select[name="style"]').on('change', function() {
$('div#details').empty();
var Style = 'contact-two' //when this value is selected return below
if(Style) {
$.ajax({
type: "GET",
dataType: "json",
success:function() {
$('div#details').empty();
$('div#details').append('<p>Here will be appended inputs</p>');
}
});
} else {
$('div#details').empty();
}
});
});
</script>
答案 1 :(得分:1)
这种操作可以通过一个查询完成。
update PRACOWNICY
set Zarobki =
case when Zarobki < 3000 then
Zarobki * 2
else
zarobki /2
end
此查询等同于
update PRACOWNICY set Zarobki = Zarobki * 2
where Zarobki < 3000;
update PRACOWNICY set Zarobki = Zarobki / 2
where Zarobki >= 3000;