Freelancer job part time jobs

  • Home
  • Jobs hiring now
  • FAQ
  • Contact

SQL HAVING – SQL tutorial

March 1, 2011 by Freelance Leave a Comment

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on Google+ (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • More
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to email this to a friend (Opens in new window)
  • Click to print (Opens in new window)

If we want to get the result of the sales of those stores which have more than $1300 salary, then we have to use a clause known as WHERE. If we have to use a function related to aggregation then the clause HAVING will be used. The statement which has HAVING as a clause can have a GROUP BY command. The basic structure of HAVING clause is this,

SELECT "column_name1", SUM("column_name2")
FROM "table_name"
GROUP BY "column_name1"
HAVING (arithmetic function condition)

It should be cleared that GROUP BY is not necessary clause.
Store_Information

store_name  Sales   Date
San Diego   $1550   Jan-06-2011
San Diego   $200    Jan-07-2011
Los Angeles $350    Jan-08-2011
Boston  $750    Jan-08-2011

The syntax is

SELECT store_name, SUM(sales)
FROM Store_Information
GROUP BY store_name
HAVING SUM(sales) > 1300

Product:

store_name      SUM(Sales)
San Diego       $1750

100% Bonus

Share this:

  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on Google+ (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • More
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to email this to a friend (Opens in new window)
  • Click to print (Opens in new window)
SQL Alias – SQL tutorial
SQL Outer Join – SQL tutorial
SQL GROUP BY – SQL tutorial
SQL LIKE – SQL tutorial
SQL UPDATE – SQL tutorial
SQL DELETE – SQL tutorial
SQL BETWEEN – SQL tutorial
SQL AS – SQL tutorial
SQL Join – SQL tutorial
SQL WHERE – SQL tutorial
Sql Select – SQL tutorial
SQL Average – SQL tutorial
SQL AND OR – SQL tutorial

Filed Under: SQL

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

CAPTCHA
Refresh

*

Earn money as trader

Earn from home ads

HotForex Bonus

Work from home ads

Work from home as instaforex forex trader

instaforex bonus 30%

Freelance categories

  • Earn money as webmaster
    • Advertising
    • Affiliate program
    • Amazon
    • Bidvertiser
    • Blogging
    • Facebook
    • Google Adsense
    • Hosting
    • Komoona
    • LinkedIn
    • Neteller
    • SEO
    • Skrill Moneybookers
    • Twitter
  • Education
    • How to do
    • Job description glossary
    • Wordpress how to do
  • Freelancer advice tips
    • Forex trading from home
      • Affiliate programs
        • 500affiliates
        • Avapartner
        • Etoropartners affiliate program
        • HotForex Affiliate program HFaffiliates
      • Binary options trading
        • Anyoption
        • OptionBit Review
        • TradeRush
        • Ubinary
        • Yesoption
      • Facebook IPO price – buy facebook stock
      • Forex brokers reviews
        • 4XP Review
        • Alpari Russia Review
        • Alpari UK
        • AvaTrade Review
          • AvaFx Review
        • DeltaStock Review
        • Directfx Review
        • DukaScopy Review
        • Easy Forex Review
        • Etoro Review
        • ETX Capital Review
        • Exness
        • Forex.com Review
        • Forex4you
        • ForexYard Review
        • FXCM Review
        • FXDD Review
        • FxOpen Review
        • Fxpro Review
        • HiWayFX review
        • Hotforex Review
        • HY Markets Review
        • IC Markets Forex Review
        • IFC Market
        • IForex Review
        • IG Markets
        • Instaforex Review
        • Ironfx Review
        • Keystock Review
        • LCG review
        • Liteforex broker
        • Marketiva Review
        • Markets.com Review
        • NordFx Review
        • Pepperstone Review
        • Plus500 review
        • Roboforex
        • SwissQuote Bank Review
        • Thinkforex
        • UFX Markets review
        • Windsor Brokers Review
        • XeMarkets Review
        • xForex
        • Xtrade Review
        • Youtrade FX Review
        • Zulutrade Review
    • Freelance glossary
    • Freelance Programming tips
    • Learn about programming
      • C++
      • Linux
      • PHP
      • Ruby on rails
      • SQL
    • Top freelance websites
    • Web Design tips
    • Work from home business
    • Writing tips
  • Freelancer job news
    • Job advice
    • Thinking
    • Worldwide job offers
  • IT news
  • Jobs

Best Forex Brokers Reviews

  • Avafx Review – how to earn in forex market using Avafx Forex Broker
  • Avatrade Review
  • eToro Review
  • Alpari NZ Review
  • InstaForex Review
  • DukaScopy Review – Swiss bank Forex broker
  • Forex.com Review – how to earn money in forex market as trader
  • Ironfx Review
  • FXCM Review
  • FxOpen Review
  • Hotforex Review
  • Markets.com Review
  • UFX Markets Review
  • Zulutrade Review – earn money using free forex signals where forex experts trade for you
  • Exness forex broker Review
  • Fxpro Review
  • LiteForex forex broker review
  • NordFx Review and bonus
  • Roboforex forex broker Review
  • XM.com Review - Xemarkets forex broker review

Navigation

  • Home
  • Jobs hiring now
  • FAQ
  • Contact

Languages

  • Arabic language
  • Bengali language
  • Communiqué de presse
  • China language
  • Pressemitteilung
  • Japanese language
  • Comunicado de imprensa
  • Russian language
  • Presione soltar
  • Turkish
  • Comunicato stampa
  • Hindi language

Recent articles

  • How to earn money as freelancer ?
  • LCG broker Review
  • Forex vs. stocks – Which is a Better for Trading ?
  • Thinkmarkets Review
  • FxPro Review – download FxPro Metatrader – tight spreads
Freelancer job - Copyright 2007
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.