Re: ? bug pg 9.6
От | Thom Brown |
---|---|
Тема | Re: ? bug pg 9.6 |
Дата | |
Msg-id | CAA-aLv5TZt0PQhLffiofBOw7wW_q7FCsYF29B-KEhHyKDKTfwQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: ? bug pg 9.6 ("alain bourgeois" <a.bourgeois@zetescards.be>) |
Список | pgadmin-support |
On 25 August 2017 at 13:19, alain bourgeois <a.bourgeois@zetescards.be> wrote: > But t1 is not in the select list... (and this doesn't work in oracle nor > mariadb)... It is "strange" but not blocking. You can refer to the whole table like you would with columns in a query, so it's valid. For example: SELECT tablename FROM tablename; This will return the table's data as a single column, the type of which is the table itself. SELECT DISTINCT (tablename) tablename, count(*) FROM tablename GROUP BY tablename HAVING count(*) > 1 ORDER BY tablename; This will effectively show you which rows are duplicated, and how many times they are duplicated. And being able to pass the table to a function can be really useful. For example: SELECT to_jsonb(tablename) FROM tablename; This will output the table data as JSON, and use the column names as the keys. Thom
В списке pgadmin-support по дате отправления: