Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
FlujoPadre
--PostgreSQL 9.6 --'\\' is a delimiter select version() as postgresql_version; -- Table: public."AssistancesHelpStates" -- DROP TABLE public."AssistancesHelpStates"; drop table if exists "FlowBotStates"; CREATE TABLE "FlowBotStates" ( id character varying(3) COLLATE pg_catalog."default" NOT NULL DEFAULT to_hex((floor((date_part('epoch'::text, now()) * (10000)::double precision)))::bigint), name character varying(50) COLLATE pg_catalog."default", description character varying(100) COLLATE pg_catalog."default", flow_bot_state_id character varying(3), CONSTRAINT "FlowBotStates_pkey" PRIMARY KEY (id) ) WITH ( OIDS = FALSE ); insert into "FlowBotStates" (id, name, description) values ('001', 'consultas', 'Teleasesoria'); insert into "FlowBotStates" (id, name, description) values ('002', 'agros_comparte', 'Agros comparte'); insert into "FlowBotStates" (id, name, description, flow_bot_state_id) values ('003', 'constulta_agronomica', 'Consulta por su cultivo','001'); insert into "FlowBotStates" (id, name, description, flow_bot_state_id) values ('004', 'constulta_legal', 'Consulta lega','001'); insert into "FlowBotStates" (id, name, description, flow_bot_state_id) values ('005', 'constulta_clima', 'Consulta por clima','001'); select hijo.description as hijo, padre.description as padres from "FlowBotStates" as hijo left join "FlowBotStates" as padre on padre.id = hijo.flow_bot_state_id; drop table if exists "FlowBotStates";
run
|
edit
|
history
|
help
0
Return IDs where there are exactly 3 occurrences1
Query integer in text field - Seemingly doesn't work as expected
Mandelbrot
Query for matching substring from text field in DB
SQL social network practice by Han Wang 20200720 - 2
w3c sql data
Recursive inefficiency
test
IF IN POSTGRESQL
PC02-DB-UTEC