Buscar en moleculax

Este blog es un ensayo digital donde el pensamiento estructurado se encuentra con la introspección profunda. Explora la arquitectura del conocimiento: desde lo técnico hasta los fundamentos éticos. Aquí, cada algoritmo tiene propósito, cada línea de código refleja intención, y cada reflexión filosófica busca optimizar no solo sistemas, sino también decisiones humanas. Este blog no solo enseña a pensar, enseña a discernir, a construir con sentido. Porque el verdadero desarrollo nace de la conciencia, y eso exige precisión, virtud y coraje.

Tenemos que aprender a contemplar las potenciales consecuencias de nuestros planes, para impedir que nos sorprendan. De esta manera, tendremos más control sobre las situaciones difíciles ya que el verdadero progreso no se mide por la velocidad con la que avanzamos, sino por la dirección que elegimos. En un mundo cada vez más interconectado, el desarrollo de la humanidad exige más que tecnología y conocimiento: requiere conciencia, empatía y propósito.

Debemos cultivar una inteligencia que no solo resuelva problemas, sino que los prevenga con sabiduría. Una ciencia que no solo descubra, sino que se pregunte por qué y para quién. Una economía que no solo crezca, sino que reparta con justicia. Y una cultura que no solo celebre lo diverso, sino que lo abrace como fuerza vital.

Cada decisión que tomamos, cada palabra que decimos, cada idea que compartimos, puede ser una semilla de transformación. El futuro no está escrito: lo estamos escribiendo juntos, ahora mismo.

Que el desarrollo humano sea integral, sostenible y profundamente humano. Porque solo cuando elevamos a todos, nos elevamos como especie.

Sabiduría Justicia Templanza Coraje
PostgreSQL Joins


PostgreSQL join is used to combine columns from one (self-join) or more tables based on the values of the common columns between the tables. The common columns are typically the primary key columns of the first table and foreign key columns of the second table.
PostgreSQL support inner join, left join, right join, full outer joincross joinnatural join, and a special kind of join called self-join.

Setting up sample tables

Suppose we have two tables called basket_a and basket_b that stores fruits:
The tables have some common fruits such as apple and orange. Let’s call the basket_a is the left table and basket_b is the right table.

PostgreSQL inner join

The following statement joins the left table with the right table using the values in the fruit column:
PostgreSQL Join - inner join example
As you can see clearly from the result, the inner join returns a result set that contains row in the left table that match with the row in the right table.
The following Venn diagram illustrates the inner join:

PostgreSQL left join

The following statement joins the left table with the right table using left join (or left outer join):
PostgreSQL Join - left join example
The left join returns a complete set of rows from the left table with the matching rows if available from the right table. If there is no match, the right side will have null values.
The following Venn diagram illustrates the left join:

To get the only rows from the left table but not in the right table, you use the left join then exclude the rows that you want from the right table using the WHERE clause:
The output is:
PostgreSQL Join - left join with where example
The following Venn diagram illustrates the left join with only rows from the left table:

PostgreSQL right join

The right join or right outer join is a reversed version of the left join. It produces a result set that contains all rows from the right table with matching rows from the left table. If there is no match, the left side will contain null values.
The following statement performs the right join between the left and the right tables:
Here is the output:
PostgreSQL Join - right join example
The following Venn diagram illustrates the right join:

Similarly, you can get only rows from the right table but not from the left table by adding a WHEREclause as follows:
PostgreSQL Join - right join with where example
The following Venn diagram illustrates the right join with only rows from the right table:

PostgreSQL full outer join

The full outer join or full join produces a result set that contains all rows from both the left and right tables, with the matching rows from both sides where available. If there is no match, the missing side contains null values.
The following statement illustrates the full outer join:
Note that the OUTER keyword is optional.
Here is the result set:
PostgreSQL Join - full outer example
The following Venn diagram illustrates the full outer join:

To return a set of rows unique to the left and right tales, you perform the same full join first, and then exclude the rows that you don’t want from both sides using a WHERE clause:
Here is the result:
PostgreSQL Join - right join with where example
The following Venn diagram illustrates the full outer join with only rows from both tables:


The following picture shows all the PostgreSQL joins that we discussed above with detailed syntax:




Fuente: http://www.postgresqltutorial.com

.

15dias (4) agenda 2023 (1) Algo que leer (266) Android (2) Angular (2) Apache (6) API (1) Arte y Cultura (11) Artes Marciales (10) Astro (1) Banner (1) Base de datos (35) Batalla Cultural (5) Big Data (12) Budismo (4) cabala judia (2) Calculo Asistido por computadoras (2) Canaima (6) Caos (1) Ceo (1) ciencias (1) Cine (1) Cobol (12) Cobra Kai (1) Codigo Linux Documental (2) Computación (3) Computación forense (14) Configurando Samba (1) Conocimiento (1) Consola (8) contenedores (9) Criptomonedas (3) Cultura (1) Cursos (16) Darkweeb (3) Data Mining (1) Debian (18) Deep Learning (2) DeepWeb (7) demografia (9) Deporte y Recreación (9) Deportes (10) desclasificados (7) Desktop (1) developers (1) DevOps (1) Docker (11) Document (1) Ecología (6) Editor (3) Editores (4) Educacion y TIC (31) Electronica (2) Empleos (1) Emprendimiento (7) Espiritualidad (2) estoicismo (4) Eventos (2) Excel (1) Express (1) fedora (1) Filosofía (25) Flisol 2008 (3) Flisol 2010 (1) Flisol 2015 (1) framework (2) Funny (1) Geografía (1) Gerencia y Liderazgo (72) Gestor de Volúmenes Lógicos (1) Git (7) GitHub (8) Globalizacion (5) gnu (28) Go (1) gobiernos (2) golang (2) Google por dentro (1) GraphQL (1) gRPC (1) Hackers - Documental (8) Hacking (31) Historia (3) howto (189) html (1) IA (22) IntelliJIDEA (1) Internet (6) Introducción a los patrones (2) J SON (1) java (52) java eclipse (2) javaScript (9) JDK (1) jiujitsu (4) Json (1) Junit (1) kali (39) kernel (2) Kotlin (1) Laravel (2) Latin (1) LIbreOffice (1) Libros (4) Linux (48) Linux VirtualBox (1) Literatura (1) Machine Learning (2) Manuales (42) mariaDB (1) Markdown (4) Marketing (1) Matando ladilla (9) Matematricas (1) Math (1) maven (1) metodos https (1) Modelos (1) MongoDB (17) Multimedia (1) Musica (1) mvc (2) Mysql (20) MySQL Workbench (1) Nagios (2) Naturismo (1) node (5) Node.js (6) NodeJS (9) NoSQL (1) Oracle (9) Oracle sql (9) Php (3) PL/SQL (1) Plsql (1) PNL (1) Poblacion (2) Podman (1) Poesia (1) Politica (5) Política (1) Postgresql (9) PowerShell (1) programacion (86) Psicologia (11) Python (7) React (1) Recomiendo (1) Redes (31) Redis (2) Religion (2) REST (2) Rock (1) Rock/Metal Mp3 (2) RUP (1) Salud (5) sc:snap:android-studio (1) sc:snap:datagrip (1) sc:snap:gitkraken linux (1) Seguridad (18) Seguridad con Gnu Privacy (2) Seo (1) simulaEntrevistas (10) simularExamen (10) Sistemas Operativos (69) SOAP (1) Sociedad (5) Software Libre (169) Soporte Tecnico (12) Sphinx (1) spring (1) spring boot (10) SQL (3) SQL en postgreSQL (39) Taekwondo (11) Tecnologia (5) Tecnología (27) Templarios (5) Tendencias (1) Tensorflow (4) Thymeleaf (1) Tomcat (2) Tor (9) Trialectica (3) TYPEACRIPT (1) Ubuntu (5) unix (2) Vida activa (1) Videos (11) Videos Educativos (10) Vim (1) Viral (3) Visual Studio (1) wallpaper (2) web (1) Wifi (2) Windows (3) WWW (2) Xrandr (1) Zero Trust (2)

Sabiduria Justicia Templanza Coraje.

Hay que contemplar las potenciales consecuencias de nuestros planes, para impedir que nos sorprendan. De esta manera, tendremos más control sobre las situaciones difíciles.


Powered by