除了一列之外,我有两个具有相同结构的表...表2中有另外一列我将插入CURRENT_DATE()
我想将table1中的所有值复制到table2.
如果我使用
INSERT INTO dues_storage SELECT * FROM dues WHERE id=5;
Run Code Online (Sandbox Code Playgroud)
它会抛出一个错误,指出列数的差异.
我有两个问题:
如问题中所述,如何通过javascript找到可用于网页的屏幕空间?
我使用的是 postgres 9.5。我有一个个人资料表,其中列出了姓名:
public.profiles:
id | first_name | last_name
--- --------------- ---------------------
1 Jason Bourne
2 Jhonny Quest
Run Code Online (Sandbox Code Playgroud)
我有一张发票表:
public.invoices:
invoice_id | billing_address | profile_id
------------------ ----------------------------- ---------------------
1 { 2
"address_line1": "445 Mount
Eden Road",
"city":"Mount Eden",
"country": "Auckland"
}
Run Code Online (Sandbox Code Playgroud)
我想使用配置文件表中的名字和姓氏更新发票表的 billing_address 列,例如:
public.invoices:
invoice_id | billing_address | profile_id
------------------ ----------------------------- ---------------------
1 {
"name" : "Jhonny Quest" 2
"address_line1": "445 Mount
Eden Road",
"city":"Mount Eden",
"country": "Auckland"
}
Run Code Online (Sandbox Code Playgroud)
为此,我尝试使用 jsonb_set:
UPDATE invoices AS i SET billing_address = jsonb_set(billing_address,'{name}', …Run Code Online (Sandbox Code Playgroud) 我正在使用以下代码在Firebase中检索数据:
this.managerList = this.afDB.database.ref('users').orderByChild('managedby').equalTo(uID);
this.managerList.on('value', (snapshot) => {
this.managerIdArray = Object.keys(snapshot.val());
this.managerNameArray = snapshot.val();
});
Run Code Online (Sandbox Code Playgroud)
每当返回null值时,我都会收到一个错误:错误:未捕获(承诺中):TypeError:无法读取未定义的属性............。
当我尝试在上面添加catch()时,它说不能使用catch()或then()。如何使用catch()报错。
我已经尝试纠正下面的代码.但我无法找到解决方案.执行代码后,firebug说"document.getElementById(haystack.value)为null".我试过if(document.getElementById(haystack).value ==null)但是没用.请帮帮我.
var haystack=document.getElementById('city1').value;
if(!document.getElementById(haystack).value)
{
alert("null");
}
else
{
alert("not null");
}
Run Code Online (Sandbox Code Playgroud)
编辑:
干草堆获得了城市的价值.当我在haystack -alert(haystack)上尝试"警报"时,我得到了肯定的答复.但当我尝试使用"document.getElementById(haystack).value"时,我收到一个错误.但有一点,干草堆获取的id元素可能存在也可能不存在.
再次编辑:
我觉得生病会自杀.我把city作为输入元素的name属性而不是id属性.对不起,但坐在电脑前这让我心烦意乱.但浪费你的时间并不是理由.请接受我诚挚的歉意.谢谢花钱帮助我.