Showing posts with label PostgreSQL. Show all posts
Showing posts with label PostgreSQL. Show all posts

Switch database on PGSQL

To switch to another database when connect to PostgreSQL Server use following command on psql.

postgres=>\connect databasename
postgres=> \c databasename
For eg: Lets say you are connected to default postgres database and want to connect to database name mydatabase, try below syntax

postgres=> \c mydatabase or postgres=> \connect mydatabase
mydatabase=>

Running Total In SQL Server

Running total refers to the sum of values in all cells of a column that precedes the next cell in that particular column. Using Window Funct...