Soluții

SQL GROUP BY Statement

The SQL GROUP BY Statement

The GROUP BY statement groups rows that have the same values into summary rows, like “find the number of customers in each country”.

The GROUP BY statement is often used with aggregate functions (COUNT()MAX()MIN()SUM()AVG()) to group the result-set by one or more columns.

GROUP BY Syntax
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
Demo Database

Below is a selection from the “Customers” table in the Northwind sample database:

CustomerID CustomerName ContactName Address City PostalCode Country
1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Germany
2 Ana Trujillo Emparedados y helados Ana Trujillo Avda. de la Constitución 2222 México D.F. 05021 Mexico
3 Antonio Moreno Taquería Antonio Moreno Mataderos 2312 México D.F. 05023 Mexico
4 Around the Horn Thomas Hardy 120 Hanover Sq. London WA1 1DP UK
5 Berglunds snabbköp Christina Berglund Berguvsvägen 8 Luleå S-958 22 Sweden

 

[mai mult...]

SQL UNION Operator

The SQL UNION Operator

The UNION operator is used to combine the result-set of two or more SELECT statements.

  • Every SELECT statement within UNION must have the same number of columns
  • The columns must also have similar data types
  • The columns in every SELECT statement must also be in the same order
UNION Syntax
SELECTcolumn_name(s)FROMtable1
UNION
SELECTcolumn_name(s)FROMtable2;
UNION ALL Syntax

The UNION operator selects only distinct values by default. To allow duplicate values, use UNION ALL:

SELECT column_name(s) FROM table1
UNION ALL
SELECT column_name(s) FROM table2;

Note: The column names in the result-set are usually equal to the column names in the first SELECT statement.

[mai mult...]

How to set Gboard as default keyboard on iPad, use one-hand mode

A lot of users prefer Gboard over the iOS keyboard. While the latter is more stable, the Gboard offers more features such as an integrated Google search bar, option to search for emojis, stickers, GIFs online, built-in Google Translate, and change themes.

Besides, Gboard lets you use swipe typing even when in full size, which is impossible on the iOS keyboard unless you switch to the floating mode. Read the guide below to set and use Gboard as your default keyboard on iPad and use one-hand swipe typing.

[mai mult...]

How to set up Windows Hello facial recognition on Windows 11

On Windows 11, you can securely sign in without taking anything on the screen using your face with the Windows Hello facial recognition feature. Windows Hello has been around for a number of years, and it’s a feature that offers several ways to ditch your password in favor of a more secure method of authentication, such as PIN, fingerprint, and face.

Although you can enable and configure the feature on virtually any device, you still need special hardware if you don’t want to use a PIN. For instance, fingerprint authentication requires a fingerprint reader, and the facial recognition option requires an infrared or Intel RealSense camera.

[mai mult...]

How to Add a Video to a Microsoft PowerPoint Presentation

In PowerPoint, you can either embed a video or link to a video from your presentation. If you embed a video, your video becomes part of the presentation, which increases the overall size of the presentation file. If you link to a video, PowerPoint only adds a reference to that video in your presentation. Lets see how to add a video to your Microsoft PowerPoint presentation.

[mai mult...]