What is the difference between GROUP BY and ORDER BY in
Sql?

Answer Posted / haritharavi

Order by clause is used to sort the rows in ascending or
descending order.Group by clause is used to sort/group a
number of rows together so as to apply aggregate functions.
So order by is only to sort the records where as group by
is to sort and find aggregate functions of each group.

Is This Answer Correct ?    32 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Please can the SQL code below be interpreted IF @xMatchCriteria='MATCH12' BEGIN IF EXISTS (Select * from #InsightData where (EmailAddress=@xDCPEmailAddress ) ) BEGIN SET @xTestMatchCriteria = @xMatchCriteria; SELECT @xCRMCustomerId=CustomerId, @xCRMDcpCustomerId=DcpCustomerId, @xCRMPortalCustomerID=PortalCustomerID,@xCRMDcpID=DcpID, @xCRMCardNumber=CardNumber, @xCRMEmailAddress=EmailAddress, @xCRMfirtLetterFirstName=firtLetterFirstName, @xCRMLastName=Surname,@xCRMAddressLine1=AddressLine1, @xCRMPostCode=PostCode FROM #InsightData where (EmailAddress=@xDCPEmailAddress ) END ELSE BEGIN SET @xTestMatchCriteria='No'+@xMatchCriteria; END END

1150


Is the syntax correct? Explain the meaning of the syntax given below: $dbc = mysqli_connect('data.aliensabductedme.com', 'owen', 'aliensrool', 'aliendatabase');

520


What are date and time data types in mysql?

515


What is mysql database used for?

478


Is mariadb faster than mysql?

463






How to include numeric values in sql statements?

496


How do I run mysql on a mac?

469


What is clob in mysql

474


How do I edit a table in mysql workbench?

431


How to delete a database from mysql server.

512


SQL is not case sensitive. DELETE is the same as delete. State Whether True or False?

568


How to convert character strings to dates?

523


Where is mysql used?

512


What is the use of concat() in mysql?

505


How to set mysql variable in php?

501