Re: Like Query help

Поиск
Список
Период
Сортировка
От Bret Stern
Тема Re: Like Query help
Дата
Msg-id e6b6dcc9-57f6-c2bc-8a18-caa442233a0e@machinemanagement.com
обсуждение исходный текст
Ответ на Re: Like Query help  ("aNullValue (Drew Stemen)" <drew@anullvalue.net>)
Список pgsql-general
Works. Thanks for the help. I will read the docs

Best

On 1/14/2021 4:37 PM, aNullValue (Drew Stemen) wrote:
> At 2021-01-14T19:27:23-05:00, Bret Stern <bret_stern@machinemanagement.com> sent:
>> query
>>
>> select company_code, item_code, item_description, product_line,
>> udf_item_width, udf_item_length, sales_unit_measure, ''as mat_type from
>> mas_combined_item_master where company_code='BUR' or company_code='SNJ'
>> or company_code='EBC' and udf_edb_managed=''
>> and item_code LIKE 'S-%' order by item_code;
>>
>> comment
>>
>> Second column is item_code...why are these items in the results.
>> Expecting the query to return results where the item_code
>>
>> starts with "S-" and includes any othervalue past "S-"
>>
> Based on your description, your query is not correct; you should rewrite it, likely using parenthesis to define your
actuallydesired value expression.
 
>
> See also https://www.postgresql.org/docs/13/sql-expressions.html#SYNTAX-EXPRESS-EVAL
>
> This may or may not be what you intended:
>
> SELECT company_code, item_code, item_description, product_line, udf_item_width, udf_item_length, sales_unit_measure,
''asmat_type
 
> FROM mas_combined_item_master
> WHERE (company_code='BUR' OR company_code='SNJ' OR company_code='EBC')
> AND udf_edb_managed=''
> AND item_code LIKE 'S-%'
> ORDER BY item_code;
>
>



В списке pgsql-general по дате отправления:

Предыдущее
От: rob stone
Дата:
Сообщение: Re: Strange (and good) side effect of partitioning ?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Strange (and good) side effect of partitioning ?