简体   繁体   English

我在 PostgreSQL 中遇到语法错误问题。 我正在尝试添加一个查询,但它给了我一个错误

[英]I am having issues with a syntax error in PostgreSQL. I am trying to add a query and it is giving me an error

I am taking a Data Analysis Course on Udemy.我正在 Udemy 上学习数据分析课程。 I am using PostgreSQL.我正在使用 PostgreSQL。 On one of my exercises, I tried to add a column of data and recieved a Syntax Error Message.在我的一个练习中,我尝试添加一列数据并收到一条语法错误消息。 Here is a screen shot of my code:这是我的代码的屏幕截图:

PostgreSQL

can someone help with this?有人可以帮忙吗?

What you're showing is a select statement你显示的是一个选择语句

SELECT DISTINCT CustomerName, Region, Industry 
FROM sales
WHERE Region = 'West'

To add another criterion, use and as follows要添加另一个标准,请使用and如下

SELECT DISTINCT CustomerName, Region, Industry 
FROM sales
WHERE Region = 'West'
 AND Industry = 'BusinessServices'

If you want to add a column to the table itself, proceed as follows如果要向表本身添加一列,请按以下步骤操作

alter table sales add column Industry varchar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL 和 python 在我尝试读取文件时出现错误 - SQL with python is giving me error when I am trying to read in a file 执行SQL查询时出现语法错误,我无法找到,请告诉我错误是什么 - Syntax error with the execution of SQL query, I am unable to find, kindly let me know whats the error 我遇到 SQL 查询问题 - I am having issues with a SQL query 为什么我的SQL语法出现1064错误? - Why am I having a 1064 error in my SQL syntax? 我在提取行数据时遇到语法错误-Postgres - I am having a syntax error in relation to pulling row data - postgres 我收到访问查询错误:“from 子句中的语法错误” - I am getting an access query error : "syntax error in from clause" 为什么在尝试使用mysql-query更新属性时会出现此语法错误? - Why am I getting this syntax-error while trying to update a attribute using mysql-query? 无法将.sql导入PostgreSQL。 语法错误 - Cannot import .sql to PostgreSQL. Syntax error 我试图用左外部联接及其给我错误子查询。 可以看看吗? 请 - I am trying to subquery with Left outer join and its giving me error. can some one take a look? Please 我正在尝试更改 object 关系 model 中的类型以向其添加成员 function,但它一直给我错误 - I am trying to alter a type in object relational model to add a member function to it, but it keeps giving me errors
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM