![]() ![]() Now let us create one table and insert values in it. The above queries will result in the access to Postgres command-prompt as follows – Let us begin by connecting to out PostgreSQL database and open the psql terminal command- prompt using the following statements – sudo su – postgres ConditionalStatements are the conditions you wish to apply in the where clause and are optional. The table name specifies the table from which we want to retrieve the result and determine the row counts. Using the DISTINCT keyword limits the result set to unique values within the specified columns. By default, it is an ALL keyword when mentioned in a particular columnName. It can be passed with either “*” to count all the rows in the result set or with a column name preceded by the distinct or all keyword, to count distinct or all values in that specific column. The count function can accept different parameters. Syntax SELECT COUNT (* | ALL | columnName) You can view EDUCBA’s recommended articles for more information.Hadoop, Data Science, Statistics & others We hope that this EDUCBA information on “PostgreSQL DISTINCT” was beneficial to you. We hope from the above article, you have understood how to use PostgreSQL SELECT DISTINCT statement to return unique rows by removing duplicate rows from the result set.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |