错误代码:1064。您的SQL语法中有一个错误; '来自portfolio.nashville_housing_data内部加入PORTFOLIO.NASHVILLE_HOUSING_DAT'在第3行

发布于 2025-02-06 07:23:22 字数 549 浏览 2 评论 0原文

在更新我的桌子时遇到问题。我对此非常新鲜,所以它可能很简单,但我无法弄清楚。

UPDATE a 
SET PropertyAddress = IFNULL(a.PropertyAddress, b.PropertyAddress)
FROM portfolio.nashville_housing_data a
INNER JOIN portfolio.nashville_housing_data b
  on a.ParcelID = b.ParcelID
  and a.UniqueID <> b.UniqueID
WHERE a.PropertyAddress is null

mysql。试图将值填充到与ParcelID相对应的PropertyAddress中。

前任。

ParcelID  PropertyAddress
11111     1234 St City
11111     NULL

由于它们具有相同的parcelID,因此需要两个值中的两个值才能读取相同的内容。

请帮助我新来。谢谢。

Having problem updating my table. Im very new at this so its probably something simple but i cant figure it out.

UPDATE a 
SET PropertyAddress = IFNULL(a.PropertyAddress, b.PropertyAddress)
FROM portfolio.nashville_housing_data a
INNER JOIN portfolio.nashville_housing_data b
  on a.ParcelID = b.ParcelID
  and a.UniqueID <> b.UniqueID
WHERE a.PropertyAddress is null

MYSQL. Trying to populate values back into PropertyAddress that correspond with ParcelID.

EX.

ParcelID  PropertyAddress
11111     1234 St City
11111     NULL

Need both values in PropertyAddress to read the same since they have the same ParcelID.

Please help I'm new at this. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反差帅 2025-02-13 07:23:22

您的Systax在MySQL中不起作用,它一定像下面

 创建表Nashville_housing_data(ParcelID INT,simelid Int,PropertyAddress varchar(50))
 
 更新nashville_housing_data a
内加入nashville_housing_data b
  在a.parcelid = b.parcelid上
  和a.uniqueid&lt;&gt; B. Uniqueid

设置a.propertyaddress = ifnull(a.propertyaddress,b.propertyaddress)
a.propertyaddress为null
 

db&lt;

You systax doesn't work in mysql, it must be like below

CREATE TABLe nashville_housing_data(ParcelID int,UniqueID int,  PropertyAddress varchar(50))
UPDATE nashville_housing_data a
INNER JOIN nashville_housing_data b
  on a.ParcelID = b.ParcelID
  and a.UniqueID <> b.UniqueID

SET a.PropertyAddress = IFNULL(a.PropertyAddress, b.PropertyAddress)
WHERE a.PropertyAddress is null

db<>fiddle here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文