Status message

Maintenant, vous regardez: PostgreSQL operator examples

PostgreSQL operator examples

1. Use NULLS FIRST and NULLS LAST options to explicitly specify the order of NULL with other non-null values.

  1. SELECT num
  2. FROM sort_demo
  3. ORDER BY num NULLS LAST;

2. PostgreSQL SELECT DISTINCT clause
The DISTINCT clause is used in the SELECT statement to remove duplicate rows from a result set.

  1. SELECT
  2. DISTINCT column1
  3. FROM
  4. table_name;

PostgreSQL also provides the DISTINCT ON (expression) to keep the “first” row of each group of duplicates using the following syntax:

  1. SELECT
  2. DISTINCT ON (column1) column_alias,
  3. column2
  4. FROM
  5. table_name
  6. ORDER BY
  7. column1,
  8. column2;
  1. SELECT
  2. DISTINCT ON (bcolor) AS bcolor,
  3. fcolor
  4. FROM
  5. distinct_demo
  6. ORDER BY
  7. bcolor,
  8. fcolor;

3.

  1. ELECT
  2. first_name,
  3. LENGTH(first_name) name_length
  4. FROM
  5. customer
  6. WHERE
  7. first_name LIKE 'A%' AND
  8. LENGTH(first_name) BETWEEN 3 AND 5
  9. ORDER BY
  10. name_length;

4.

  1. SELECT
  2. film_id,
  3. title,
  4. release_year
  5. FROM
  6. film
  7. ORDER BY
  8. film_id
  9. LIMIT 4 OFFSET 3;

5.

  1. SELECT
  2. film_id,
  3. title
  4. FROM
  5. film
  6. ORDER BY
  7. title
  8. OFFSET 5 ROWS
  9. FETCH FIRST 5 ROW ONLY;

6.

  1. SELECT
  2. customer_id,
  3. first_name,
  4. last_name
  5. FROM
  6. customer
  7. WHERE
  8. customer_id IN (
  9. SELECT customer_id
  10. FROM rental
  11. WHERE CAST (return_date AS DATE) = '2005-05-27'
  12. )
  13. ORDER BY customer_id;

7.

  1. SELECT
  2. customer_id,
  3. payment_id,
  4. amount
  5. FROM
  6. payment
  7. WHERE
  8. amount BETWEEN 8 AND 9;

8.

  1. SELECT
  2. first_name,
  3. last_name
  4. FROM
  5. customer
  6. WHERE
  7. first_name LIKE '%er%'
  8. ORDER BY
  9. first_name;

9.
Percent sign ( %) matches any sequence of zero or more characters.
Underscore sign ( _) matches any single character.

  1. SELECT
  2. first_name,
  3. last_name
  4. FROM
  5. customer
  6. WHERE
  7. first_name LIKE '_her%'
  8. ORDER BY
  9. first_name;

10.

  1. SELECT
  2. id,
  3. first_name,
  4. last_name,
  5. email,
  6. phone
  7. FROM
  8. contacts
  9. WHERE
  10. phone IS NULL;

11.

  1. SELECT
  2. f1.title,
  3. f2.title,
  4. f1.length
  5. FROM
  6. film f1
  7. INNER JOIN film f2
  8. ON f1.film_id <> f2.film_id AND
  9. f1.length = f2.length;

Tags:

Comments

buy viagra https://gopharmxx.com/ - viagra viagra pills cialis vs viagra viagra online

viagra for men https://pharmmyjo.com/ - what is viagra how does viagra work viagra online viagra connect

viagra pill https://pharmmyjo.com/ - cialis vs viagra generic viagra buy viagra online viagra generic

online viagra https://gopharmxx.com/ - what does viagra do generic viagra walmart cheap viagra viagra generic name

viagra generic https://pharmmyjo.com/ - viagra generic cheap viagra viagra canadian pharmacy ezzz how to get viagra

viagra canadian pharmacy ezzz https://mymypharmacy.com/ - viagra viagra for men otc viagra buy viagra

viagra alternative https://pharmmyjo.com/ - viagra generic viagra generic name viagra online viagra

generic viagra https://mymypharmacy.com/ - viagra for sale what does viagra do viagra pills cialis vs viagra

viagra over the counter https://edmedno.com/ - viagra for women п»їgeneric viagra viagra for women viagra alternative

viagra generic https://gopharmxx.com/ - how to take viagra viagra dosage how does viagra work cialis vs viagra

viagra vs cialis https://mymypharmacy.com/ - viagra online generic viagra generic viagra viagra

viagra https://mymypharmacy.com/ - viagra pills buy generic 100mg viagra online cheap viagra viagra for sale

cheap viagra https://mymypharmacy.com/ - online viagra online viagra viagra connect viagra generic

viagra side effects https://edmedno.com/ - what is viagra cialis vs viagra generic viagra online viagra online

what does viagra do https://edmedno.com/ - side effects of viagra viagra over the counter п»їgeneric viagra viagra price

viagra over the counter https://edmedno.com/ - what does viagra do side effects of viagra viagra dosage cheap viagra

generic viagra walmart https://pharmmyjo.com/ - viagra vs cialis viagra 100mg buy viagra viagra alternative

how long does viagra last https://gopharmxx.com/ - generic viagra viagra online viagra online how does viagra work

buy cialis http://cialishe.com/ - cialis buy cialis buy cialis generic online cialis

what does viagra do http://viagraid.com/ - generic viagra walmart viagra canadian pharmacy ezzz viagra generic cialis vs viagra

generic cialis http://cialishe.com/ - cialis 20mg generic cialis buy cialis cialis online

cheap viagra http://viagraid.com/ - generic viagra viagra generic name viagra online viagra online

cialis 20mg http://cialishe.com/ - generic cialis buy cialis cialis buy buy cialis

cialis buy http://cialishe.com/ - online cialis cialis buy cialis online cialis generic

cialis 20mg [url=http://cialishe.com/]cialis generic[/url] generic cialis cialis 20mg online cialis

generic cialis [url=http://cialishe.com/]cialis buy[/url] cialis generic online cialis cialis generic

cialis generic http://cialishe.com/ - buy cialis cialis 20mg generic cialis buy cialis

Link exchange is nothing else except it is simply placing the other person's

weblog link on your page at suitable place and other person will also do

same in support of you.

Also visit my page: website hosting services

generic cialis http://cialishe.com/ - cialis 20mg generic cialis buy cialis buy cialis

viagra and alcohol http://viagrajr.com/ - online viagra viagra viagra cost cheap viagra

buy generic 100mg viagra online http://viagracefo.com/ - cheap viagra buy generic 100mg viagra online viagra cheap viagra

over the counter viagra http://viagracefo.com/ - viagra online generic viagra generic viagra buy viagra

cialis vs viagra http://viagracefo.com/ - otc viagra cheap viagra viagra and alcohol how to get viagra

online viagra http://viagrajr.com/ - how to get viagra viagra generic viagra online for sale viagra dosage

Greetings! Very useful advice in this particular article!

It's the little changes which will make the most important changes.

Thanks for sharing!

Also visit my webpage :: cheap flights

viagra generic http://viagracefo.com/ - viagra connect buy viagra over the counter viagra herbal viagra

viagra pill http://viagracefo.com/ - viagra online online viagra viagra dosage viagra generic name

cialis online http://cialishe.com/ - cialis online cialis buy п»їcialis cialis buy

viagra online http://viagraid.com/ - otc viagra generic viagra cialis vs viagra how does viagra work

generic viagra http://viagraid.com/ - viagra generic viagra how to take viagra buy viagra

generic viagra http://viagracefo.com/ - viagra alternative otc viagra generic viagra online viagra

viagra generic name http://viagrajr.com/ - buy viagra online viagra viagra viagra online

viagra online http://viagracefo.com/ - viagra pill viagra online viagra viagra

viagra http://viagrajr.com/ - viagra how to take viagra viagra generic generic viagra online for sale

viagra generic name http://viagracefo.com/ - viagra side effects over the counter viagra generic viagra online viagra online

what is viagra http://viagracefo.com/ - viagra online viagra how to take viagra cheap viagra

online viagra http://viagracefo.com/ - generic viagra viagra for women viagra cost how to take viagra

women viagra http://viagrajr.com/ - online viagra viagra dosage how to get viagra herbal viagra

buy viagra http://viagracefo.com/ - viagra generic how to get viagra viagra vs cialis herbal viagra

cialis online http://cialishe.com/ - cialis 20mg buy cialis п»їcialis п»їcialis

Pages

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
1 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.