SQL SELECT DISTINCT Statement

The SQL SELECT DISTINCT syntax

The general syntax is:

  1. SELECT DISTINCT columnname
  2. FROM tablename

Can be used with COUNT and other aggregates

  1. SELECT COUNT (DISTINCT columnname)
  2. FROM tablename

 


 

SQL SELECT Examples

Problem: List all supplier countries in alphabetical order.

  1. SELECT DISTINCT Country
  2. FROM Supplier
  3. ORDER BY COUNTRY

Results: 16 rows

Country
Australia
Brazil
Canada
Denmark

 


Problem: List the number of supplier countries

  1. SELECT COUNT (DISTINCT Country)
  2. FROM Supplier

Results:

Count
16

Comments (80)

  1. Pingback: mơ thấy đi chợ

  2. Pingback: mơ thấy đá bóng đánh con gì

  3. Pingback: mơ thấy giày dép đánh con gì

  4. Pingback: mơ thấy chìa khóa

  5. Pingback: nằm mơ thấy cháy rừng

  6. Pingback: mơ thấy chim bồ câu đánh con gì

  7. Pingback: 토토사이트

  8. Pingback: dog food

  9. Pingback: mơ thấy cãi nhau đánh con gì

  10. Pingback: mơ thấy đỉa bám đầy người

  11. Pingback: mơ bắt cá trê

  12. Pingback: mơ thấy con ngựa

  13. Pingback: Look At This

  14. Pingback: bí kíp giữ chồng

  15. Pingback: mơ bắt được ếch đánh con gì

  16. Pingback: mơ thấy gái đánh con gì

  17. Pingback: Where Can I Buy Oxycontin

  18. Pingback: sahabatqq daftar

  19. Pingback: paito warna

  20. Pingback: https://www.paintingandplowing.com

  21. Pingback: porn

  22. Pingback: USA online gun broker

  23. Pingback: 메이저놀이터

  24. Pingback: modern office ideas

  25. Pingback: how to spot a fake rolex daytona

  26. Pingback: 메이저놀이터

  27. Pingback: ดูบอล

  28. Pingback: world market darknet

  29. Pingback: social activities for kids with autism

  30. Pingback: ilk üyelik bonusu veren bahis siteleri

  31. Pingback: W88

  32. Pingback: learning activities for host kids

  33. Pingback: dich vu seo

  34. Pingback: gửi hàng đi mỹ

  35. Pingback: 3d printer

  36. Pingback: arvest central mortgage co

  37. Pingback: bulut depolama,bulut,yedekleme,ücretsiz bulut hizmeti,en iyi bulut şirketi,en iyi bulut firması,bulut depolama fiyatı,en ucuz bulut depolama,en iyi bulut depolama hangisi,en iyi bulut depolama,bulut arşivleme sistemi,online yedekleme,bulut yedekleme

  38. Pingback: microsoft exchange mail

  39. Pingback: hp sunucu servis

  40. Pingback: bilişim danışmanlık hizmeti

  41. Pingback: Sunucu Teknik Destek

  42. Pingback: kurumsal sunucu servisi

  43. Pingback: bilişim danışmanlık sözleşmesi

  44. 응답

    We spent a lot of time at her home. Maybe so her mother could keep an eye on us. Mrs. Spencer made sure to be around, offering drinks, snacks, chit chat. I noticed that she was fairly young herself. Granted at my age, anyone over 25 was old, but she was probably mid-30s, divorced. If she was a indiction of how Carley would develop, maybe I should wait. Mrs. Spencer had fuller breasts and a nice butt. She appeared to be in great shape for her “advanced” age. I knew she was keeping an eye on me as much as I was on her and her younger daughter. Her eldest, Sharon was away at college at the time. With Mrs. Spencer around we mostly limited ourselves to holding hands and sneaking in a few light kisses. One day Mrs. Spencer caught us by surprise walking in as I’d slid my hand up from Carley’s stomach to rub her right breast through her shirt. She didn’t really need a bra yet, so I could feel her nipple, hard, through her shirt. Just this much contact had me hard also.

    https://sites.google.com/view/4rNa1ZLKeWjvoeA3 https://sites.google.com/view/gWKFWrDqtn0nT04a

  45. 응답

    hello my lovely stopforumspam member

    What are the Types of Loans in Ohio depending on the purpose
    Specific purpose payday loans in Ohio. Funds received in debt may be spent only for a specific purpose specified in the loan agreement.
    Non-purpose loan. The debtor may spend the money received at his discretion.
    Most popular specific purpose payday loans in Ohio are:

    House loan. The most common, of course, is a mortgage when the purchased property acts as collateral for a loan. Sometimes a youth loan is issued, with lighter conditions for debtors. Still quite common is a housing loan that does not imply purchased housing in the form of collateral.
    Car loan – payday loans in Ohio to a car or similar vehicle. The key is often the purchased goods, making the terms of the loan better. Also, loan conditions are improved: car insurance, life and health insurance of the borrower, and receiving a salary to the account of the creditor bank.
    Land loan. To purchase a plot for construction or agricultural activities.
    Consumer. For purchases in modern supermarkets, equipment stores, you can take a personal loan right at the point of sale. Often, specialists located there can contact the bank and get a regular or fast payday loans. Borrowed funds automatically pay for the goods, and the consultant explains when and how to re-pay the debt.
    Educational loan. It is issued to students, as well as to applicants who have passed the competition, to pay for tuition at universities, colleges, etc.
    Broker loan. For the circulation of securities, payday loans in Ohio are issued to an exchange broker, se-curities are purchased securities.
    Others. Objectives not related to those listed, but agreed and approved by the creditor.

  46. 응답

    hello my lovely stopforumspam member

    Welcome to Grosvenor Casinos, where you can play a wide range of casino games, from slots to poker, blackjack, and roulette! There’s something for everyone here – become a member of the casino to have the best of online casino gaming. Our Sportbook offers a range of sports betting odds and is available for pre event or in play bets 24/7 and 365 days of the year. Whether you’re here for football tournaments or the latest betting odds for horse racing, Tennis, Golf, Cricket and even Rugby Union, you are covered.

  47. Pingback: mature gay sex games

  48. 응답

    japanese sex video games
    [url=”https://sexgamesx.net/?”]multiplayer online sex games[/url]
    sex games vegas ancensored

  49. 응답

    I just couldn’t depart your website before suggesting that I extremely enjoyed the standard information a person provide for your visitors? Is gonna be back often to check up on new posts

  50. 응답

    Very interesting info !Perfect just what I was looking for! “If you want to test your memory, try to recall what you were worrying about one year ago today.” by Rotarian.

  51. 응답

    Simply desire to say your article is as astonishing. The clarity in your post is simply excellent and i could assume you’re an expert on this subject. Well with your permission let me to grab your feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.

  52. 응답

    You are my aspiration, I have few web logs and occasionally run out from brand :). “‘Tis the most tender part of love, each other to forgive.” by John Sheffield.

Leave a comment

이메일 주소는 공개되지 않습니다.