CREATE TABLE dual(VALUES(true));
SELECT now() FROM dual;
SELECT 'Hola, mundo!!' FROM dual;
DROP TABLE public.contactos;
CREATE TABLE public.contactos
(
nombre character varying,
telefono character varying,
id integer NOT NULL DEFAULT nextval('contactos_id_seq'::regclass),
CONSTRAINT contactos_pkey PRIMARY KEY (id)
);
INSERT INTO public.contactos(nombre,telefono) VALUES('Mario','7332222'),('Jimena','54333'),('Oscar','533333'),('Monica','8776767');
SELECT concat('Contactos: ',(SELECT count(*)
as cantidad FROM public.contactos)) AS consulta FROM dual;
SELECT 'Contactos: '||(SELECT count(*) as cantidad FROM public.contactos) AS consulta FROM dual;
Ejemplo de consultas en postgres. Aunque la tabla 'dual' ya esta implicita
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.