Wednesday 1 December 2021

What are the difference between where and having clause of sql? Sql मे Where and having क्लॉज़ मे क्या अंतर है|


1.

WHERE Clause is used to filter the records from the table based on the specified condition.

WHERE क्लॉज का उपयोग निर्दिष्ट शर्त के आधार पर Table से रिकॉर्ड्स को छटनी करने के लिए किया जाता है।

HAVING Clause is used to filter record from the groups based on the specified condition.

निर्दिष्ट शर्त के आधार पर समूहों से रिकॉर्ड फ़िल्टर करने के लिए HAVING क्लॉज़ का उपयोग किया जाता है



2.

WHERE Clause can be used without GROUP BY Clause

Where क्लॉज का इस्तेमाल Group By क्लॉज के बिना किया जा सकता है

HAVING Clause cannot be used without GROUP BY Clause

HAVING क्लॉज का इस्तेमाल Group By क्लॉज के बिना नहीं किया जा सकता है


3.

WHERE Clause implements in row operations

Where क्लॉज़ row निकालने के लिए किया जाता है

HAVING Clause implements in column operation

कॉलम ऑपरेशन में क्लॉज लागू होना


4.

WHERE Clause cannot contain aggregate function

Where clause अग्रेगेट फंक्शन नहीं रखता है

HAVING Clause can contain aggregate function

HAVING क्लॉज में एग्रीगेट फंक्शन हो सकता है



5.

WHERE Clause can be used with SELECT, UPDATE, DELETE statement.

Where caluse को SELECT, UPDATE, DELETE statement के साथ use किया जा सकता है

HAVING Clause can only be used with SELECT statement.

HAVING क्लॉज का उपयोग केवल SELECT स्टेटमेंट के साथ किया जा सकता है


6.

WHERE Clause is used before GROUP BY Clause

Where caluse को Group By से पहले use किया जाता है

HAVING Clause is used after GROUP BY Clause

क्लॉज का इस्तेमाल Group By क्लॉज के बाद किया जाता है


7.

WHERE Clause is used with single row function like UPPER, LOWER etc.

WHERE क्लॉज का उपयोग सिंगल रो फंक्शन जैसे UPPER, LOWER आदि के साथ किया जाता है।

HAVING Clause is used with multiple row function like SUM, COUNT etc.

HAVING क्लॉज का उपयोग कई रो फंक्शन जैसे SUM, COUNT आदि के साथ किया जाता है।





No comments:

Post a Comment