- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
要创建具有特定长度的索引,我使用以下查询:
CREATE INDEX users_full_name_idx ON users ((full_name::varchar(16)));
这段代码工作正常。但是,如果我尝试执行以下操作:
CREATE INDEX users_full_name_idx ON users (full_name::varchar(16));
我收到错误。谁能解释为什么我们需要两个而不是一个牙套。
最佳答案
An index column need not be just a column of the underlying table, but can be a function or scalar expression computed from one or more columns of the table. This feature is useful to obtain fast access to tables based on the results of computations.
CREATE INDEX test1_lower_col1_idx ON test1 (lower(col1));
CREATE INDEX people_names ON people ((first_name || ' ' || last_name));The syntax of the CREATE INDEX command normally requires writing parentheses around index expressions, as shown in the second example. The parentheses can be omitted when the expression is just a function call, as in the first example.
和CREATE INDEX :
The key field(s) for the index are specified as column names, or alternatively as expressions written in parentheses.
关于sql - 在 PostgreSQL 中创建一定长度的索引时用双括号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49925791/
我正在尝试开发右边框/Angular 具有特定 Angular (30°) 的表格。我见过一些类似的解决方案,但它们都无法在一定程度上发挥作用。如果我想从 30° 改变到 20°,我不想花太多力气。
我是一名优秀的程序员,十分优秀!