“SQL SELECT” Code-Antworten

SQL SELECT

SELECT * FROM table_name;
-- Sorting col1 ASCending then col2 DESCending
SELECT col1, col2 FROM table_name ORDER BY col1 ASC, col2 DESC;
-- Filter on col1
SELECT col1, col2 FROM table_name WHERE col1 = 'a value';
-- Containing 'searched'
SELECT col1, col2 FROM table_name WHERE col1 LIKE '%searched%';
-- All different values
SELECT DISTINCT col1 FROM table_name;
-- Simple sum
SELECT col1, sum(col2) FROM table_name GROUP BY col1;
VasteMonde

SQL SELECT

SELECT * FROM products WHERE stock_count <= 10 ORDER BY stock_count ASC;
DevLorenzo

Rückgabespalten aus der Tabelle SQL zurück

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS -- INFORMATION_SCHEMA is an ANSI-standard (American National Standard Institute) set of read-only views which provide information about all of the tables, views, columns, and procedures in a database
WHERE TABLE_NAME = N'Customers' -- "N" defines the subsequent string (the string after the N) as being in unicode
CodeHelper

SQL SELECT

SELECT * FROM TABLE_NAME;
Wicked Wolverine

SQL SELECT

SELECT first_name, last_name
FROM Customers;
SAMER SAEID

SQL SELECT

Mit SELECT können Daten aus der Datenbank abgefragt werden. Es ist die am 
meissten verbreitete Art.

  SELECT name
  FROM country
  WHERE region = (
      SELECT region
      FROM country
      WHERE name = 'Brasilien'
      )
Eager Elephant

Ähnliche Antworten wie “SQL SELECT”

Fragen ähnlich wie “SQL SELECT”

Weitere verwandte Antworten zu “SQL SELECT” auf Sql

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen