Posts

Showing posts with the label Group By & Difference between WHERE and HAVING clause

BAPI for material storage location Add

 We can add material storage location plant wise using third party app or web. BAPI names : BAPI_MATERIAL_MAINTAINDATA_RT Import parameters: HEADDATA: Material Tables: STORAGELOCATIONDATA: Material: Plant: STGE_LOC:   STORAGELOCATIONDATAX: Material: Plant: STGE_LOC:   use below code after completing steps. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.        

Group By & Difference between WHERE and HAVING clause

Group By: In SQL Server we have got lot of aggregate functions. Likes: 1. Count() 2. Sum() 3. avg() 4. Min() 5. Max() Group by clause is used to group a selected set of rows into a set of summary rows by the values of one or more columns or expressions. It is always  used in conjunction with one or more aggregate functions. Syntax look likes : SELECT COUNT (Column name), column name1 FROM table name GROUP BY column name1; Filtering Groups:   WHERE clause is used to filter rows before aggregation, where as HAVING clause is used to filter groups after aggregations. The following 2 queries  produce the same result. Filtering rows using WHERE clause, before aggregations take place: Select Column name, SUM (column name) from table name Where column name = condition group by column name (By which we want to filter our result) Filtering groups using HAVING clause, after all aggregations take place: Select Column name, SUM (column name) from t...