SQL question

2023-01-14 Thread hamann . w
Hi, I have atable with a "name" column, and I order it usually order by regexp_match(name, 'regex1'), regexp_match(name, 'regex2') orthe equivalent order by (regexp_match(name, 'regex1'))[1], (regexp_match(name, 'regex2'))[2] Is there a wayto create a function so the statement could read select

Re: short sql question

2021-06-18 Thread Georg H.
Hi, Am 18.06.2021 um 09:15 schrieb goldgraeber-werbetech...@t-online.de: Hi, I just cannot see what is wrong with my query: create table files (id int, name text, prev_name text, ); create table fnchanged (id int, name text); update files f set prev_name = f.name, name = c.name from fncha

short sql question

2021-06-18 Thread goldgraeber-werbetechnik
Hi, I just cannot see what is wrong with my query: create table files (id int, name text, prev_name text, ); create table fnchanged (id int, name text); update files f set prev_name = f.name, name = c.name from fnchanges c where f.id = c.id and c.name != f.name --- gets syntax error at "

Re: SQL Question about like

2020-08-10 Thread Michael Nolan
> > Sorry about the top-posting, Firefox and I disagreed about whether I was > done editing the previous message. > -- Mike Nolan

Re: SQL Question about like

2020-08-10 Thread Michael Nolan
I usually use something like trim(field) like 'pattern'. Eliminates the need for the wildcard at the end. I find I use the ~ operator more than 'like' though. -- Mike Nolan On Mon, Aug 10, 2020 at 12:24 PM Adrian Klaver wrote: > On 8/10/20 10:01 AM, Michael Nolan wrote: > > The problem is your

Re: SQL Question about like

2020-08-10 Thread Adrian Klaver
On 8/10/20 10:01 AM, Michael Nolan wrote: The problem is your field is fixed length text, change it to varchar(100) or text and it works without the wildcard at the end. That assumes values don't get entered with spaces: create table lll (text varchar(100)); insert into lll (text) values ('10

Re: SQL Question about like

2020-08-10 Thread Michael Nolan
The problem is your field is fixed length text, change it to varchar(100) or text and it works without the wildcard at the end. -- Mike Nolan

Re: SQL Question about like

2020-08-10 Thread Adrian Klaver
On 8/10/20 9:37 AM, p...@gmx.de wrote: Hello, my SQL question is, why psql doesn't return the record? create table lll (text char(100)); insert into lll (text) values ('10% - Ersthelfer'); select * from lll where text like '10% - Ersthelfer'; Other databases (Maria,

Re: SQL Question about like

2020-08-10 Thread Ron
On 8/10/20 11:37 AM, p...@gmx.de wrote: Hello, my SQL question is, why psql doesn't return the record? create table lll (text char(100)); insert into lll (text) values ('10% - Ersthelfer'); select * from lll where text like '10% - Ersthelfer'; Other databases (Ma

SQL Question about like

2020-08-10 Thread p...@gmx.de
Hello, my SQL question is, why psql doesn't return the record? create table lll (text char(100)); insert into lll (text) values ('10% - Ersthelfer'); select * from lll where text like '10% - Ersthelfer'; Other databases (Maria, SQL Server, YARD) do this. What can I do