SQL to Show Database Information

Your rating: None Average: 5 (2 votes)

Here is a quick SQL snippet to show some Database information. I'm only pulling Database name, date created, database owner Id and database long name.

SELECT A.NAME,
  B.DBNAME,
  A.CREATED,
  B.OWNERID,
  C.LONGNAME
FROM V$DATABASE A,
  PS.PSDBOWNER B,
  PSOPTIONS C;

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!

Comments

Have a question? Please ask it on the forum instead.
Laura McCracken's picture
Laura McCracken (not verified)
SQL Script

Hello,
Could you help me? I need to place a script on a page in my website that displays the affiliates names and state they live in -
from the newest to the oldest.

Just for example sake lets say my database name is: affiliates
the fields involved are firstname, lastname, state ...

Could you show me the script that would do that?

Thank you.

CompShack's picture
User offline. Last seen 15 weeks 4 days ago. Offline
Joined: 12/09/2007
Posts: 167
Lets See

I'm thinking you mean table name affiliates and not database name. you will need to find a way to display the results on your page but the SQL to pull the data from the database would look something like this:

SELECT firstname, lastname, state
FROM affiliates
GROUP BY firstname, lastname, state
ORDER BY date DESC
-- the order by is to order affiliates from the newest to the oldest

n/a

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
1 + 6 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.