Total Page Preview:   000000009155

What is Having function in SQL in English and Hindi

 

 SQL Having  function in Engilsh

In SQL, a function is a pre-defined or user-defined routine that can accept input parameters, perform specific operations, and return a result. Functions can be used to simplify complex calculations or queries, and they can be used in various parts of SQL queries such as SELECT, WHERE, HAVING, ORDER BY, and GROUP BY clauses.

The HAVING clause is used to filter the result set of an SQL query based on a condition that is applied to the result of an aggregate function. Here's an example of using the HAVING clause with an aggregate function:
here's an example of using the HAVING function in SQL with a tabular representation:
 
Consider a table named "orders" with the following data:
To find the total orders for each customer, we can use the following SQL query:
The result of this query will be:
Now, suppose we want to find only those customers who have placed more than one order. To do this, we can use the HAVING function as follows:
The result of this query will be:
In this query, the HAVING function filters the result set to only include customers who have placed more than one order, by checking the count of orders for each customer and selecting only those customers whose count is greater than 1.
 
 
 
 

SQL Having  function in Hindi

SQL mein, HAVING function ek aisa function hai jo result set ko aggregate function ki output ke basis par filter karne ke liye istemal kiya jata hai. HAVING function GROUP BY clause ke baad istemal kiya jata hai. Yeh function WHERE clause se different hota hai kyunki yeh aggregate function ke basis par filter karta hai jabki WHERE clause non-aggregate function ke basis par filter karta hai.
 
Yahan ek tabular example diya gaya hai jismein HAVING function ka istemal kiya gaya hai:
Maan lijiye humare paas ek "orders" table hai jismein kisi company ki orders ki jaankari hai. Har order ke liye order id, customer id, order date aur order total shamil hain. Har customer ke liye total orders ki jaankari dhoondhne ke liye, hum neeche diye gaye SQL query ka istemal kar sakte hain:
 
 
Is query ka result set niche diya gaya hai:

Ab maan lijiye ki hum sirf un customers ko dhoondhna chahte hain jo ek se zyada orders place kiye hain. Is ke liye, hum HAVING function ka istemal kar sakte hain, jaisa ki neeche diya gaya hai:

Is query ka result set niche diya gaya hai:

Is query mein HAVING function result set ko filter karta hai aur sirf un customers ko shamil karta hai jo ek se zyada orders place kiye hain. Is ke liye, COUNT aggregate function ko istemal kiya jata hai jo har customer ke orders ki ginti ko count karta hai.

 

 

 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments

Gore
09-Feb-2017
Hello everyone, it's my first pay a quick visit at this web page, and paragraph is truly fruitful in favor of me, keep up posting these posts.
Lawanya kumar
14-Mar-2019
Thanku so much sir really it's very helpful and several time asking in interview
Lawanya kumar
14-Mar-2019
Thanku so much sir really it's very helpful and several time asking in interview
Lawanya kumar
14-Mar-2019
Thanku so much sir really it's very helpful and several time asking in interview
Butcher
14-Feb-2017
I need to to thank you for this excellent read!! I definitely enjoyed every bit of it. I've got you book-marked to check out new stuff you post…
McCranie
26-Aug-2020
This piece of writing will help the internet viewers for building up new weblog or even a weblog from start to end.
Taubman
31-Jan-2017
If you are going for most excellent contents like myself, simply pay a quick visit this site daily since it offers feature contents, thanks
Suttor
21-Nov-2019
Hi mates, its wonderful post regarding cultureand entirely defined, keep it up all the time.
Wise
12-Aug-2020
This text is worth everyone's attention. Where can I find out more?
Rahman
16-Nov-2019
Terrific post however I was wanting to know if you could write a litte more on this subject? I'd be very grateful if you could elaborate a little bit more. Appreciate it!
Minns
21-Nov-2019
I do not know whether it's just me or if perhaps everyone else encountering issues with your website. It appears like some of the written text within your content are running off the screen. Can someone else please comment and let me know if this is happening to them too? This may be a problem with my browser because I've had this happen previously. Kudos
Gerrard
21-Nov-2019
Yes! Finally something about quest bars cheap.
Keck
22-Nov-2019
Hello all, here every person is sharing these kinds of know-how, so it's nice to read this webpage, and I used to go to see this web site every day.
Emmons
12-Nov-2019
My partner and I stumbled over here from a different web page and thought I may as well check things out. I like what I see so now i am following you. Look forward to looking over your web page again.
Kruttschnitt
16-Nov-2019
I would like to thank you for the efforts you have put in penning this blog. I really hope to check out the same high-grade content from you in the future as well. In fact, your creative writing abilities has motivated me to get my own blog now ;)
Ramsden
13-Nov-2019
It's appropriate time to make some plans for the longer term and it's time to be happy. I have read this put up and if I may just I wish to recommend you some interesting issues or tips. Maybe you can write next articles relating to this article. I wish to read even more things about it!
Gadsden
26-Jun-2020
Unquestionably believe that which you said. Your favorite reason seemed to be on the net the easiest thing to be aware of. I say to you, I certainly get irked while people think about worries that they plainly don't know about. You managed to hit the nail upon the top and also defined out the whole thing without having side-effects , people could take a signal. Will probably be back to get more. Thanks
Nation
26-Jun-2020
Heya! I just wanted to ask if you ever have any problems with hackers? My last blog (wordpress) was hacked and I ended up losing many months of hard work due to no data backup. Do you have any methods to stop hackers?
Lance
22-Oct-2020
Excellent beat ! I wish to apprentice while you amend your web site, how could i subscribe for a blog web site? The account helped me a appropriate deal. I had been a little bit acquainted of this your broadcast offered brilliant clear concept
Makutz
01-Mar-2021
Good post. I certainly appreciate this site. Thanks!
Counts
02-Feb-2021
Many thanks! This is definitely an astonishing webpage!
Gatlin
15-Mar-2021
WOW just what I was searching for. Came here by searching for What is difference between Peek vs Keep or MVC TempData – Peek vs Keep
Nesmith
22-Mar-2021
Simply desire to say your article is as amazing. The clearness for your post is simply spectacular and i could think you are a professional on this subject. Fine along with your permission let me to take hold of your feed to keep updated with imminent post. Thanks one million and please keep up the rewarding work.
Baddeley
21-Jul-2021
Hookup Girls Utilizes Free of charge Matters? A Fantastic Side to side Reward! Free hookup ladies chat hookups on the web is the solution if you're tired of going to pubs and organizations just to be prevented, and even worse, laughed at. I understand what it's like because I've been there. I had been solitary and needy back in the day -- I needed a new lover -- but I continued attempting because I had hardly any other choice. If you're one particular gentleman who wants to hookup with alluring women without likely to those locations where ladies are alone, then this post may just make positive changes to lifestyle. It can clarify why dating on the web is the perfect substitute if you're a guy who may be shy to method a beautiful girl in a nightclub or club.
Rotton
13-Jun-2021
Hi there! Someone in my Myspace group shared this site with us so I came to give it a look. I'm definitely loving the information. I'm book-marking and will be tweeting this to my followers! Fantastic blog and wonderful style and design.

                           
                           

                           

                           

Facebook User: