I want to retrieve all table names and column names IN A SCHEMA. So if I am in schema scott it should only show all the tables present in scott.  And can the query below only retrieve the tables in a schema?  Select * from tab;
19593
How do I query an Oracle database to display the names of all tables in it?
122524
I tried dropping a table and then when i viewed the recycle bin nothing was there in it . Earlier too i dropped tables many a times but I was surprised to find no objects whatsover in it . What's the deal ? [update]: i had tried    SHOW PARAMETER RECYCLEBIN;  Its VALUE column shows it  as ON . So fine here ! Then i droppped an existing table but still the command     Select object_name from recyclebin;  and any such retrieval of columns is showing NO ROWS SELECTED !! Also using flashback command  confirms that recyclebin is not having any such dropped tables !! So where are dropped tables going ? And one more thing : This time i tried using  ALTER SYSTEM SET RECYCLEBIN=ON;    Instead of Alter session    and sqlplus throws an error : Specified initialization parameter is not modifiable with this option  So, is this because  that i am working as a SYSTEM ?? i have not created any other USER as of now .
114133
I'm running a project on a Postgres database and need to retrieve the comments on columns within the DB to be used as table headings and such. I have seen that there are a couple of built in functions ( and ) but i haven't been able to find examples on how to use them and playing around with them has proved pretty futile.  So I was wondering if any has been able to do this before and if so, how?
8920
What SQL can be used to list the tables, and the rows within those tables in an SQLite database file - once I have attached it with the ATTACH command on the SQLite 3 command line tool?
23100
I'm trying to figure out how to locate all occurrences of a url in a database. I want to search all tables and all fields. But I have no idea where to start or if it's even possible.
20479
I have a shapefile whose features I can filter by specifying a where clause in the query dialogue. F.x. I have a field named 'city_name' and by stating 'city_name = "London"' in the where clause only London is displayed. What I would like to do now is to fetch all values in 'city_name' from the attribute table.   Something like that:  select distinct city_name from [attribute table]   I found several tools in QGIS apparently dealing with SQL and I also had a quick look at the different Plugins. But I fail at connecting to a database or the table name ... what database or which table in that case?   In the end I want to export the result list and use it for further processing.  I am using QGIS 1.8.
95576
Supposing we have a table with four columns (a,b,c,d) of the same data type.  Is it possible to select all distinct values within the data in the columns and return them as a single column or do I have to create a function to achieve this?
66578
SO and Internet contains a lot of answers to question how to create read only user (for example see  article), BUT all of them promote the following way:   Create user Grant USAGE privilege to all existing schemas Grant SELECT privilege to all existing tables in all existing schemas Grant default SELECT privilegie to all tables (which can be created in the future) for all existing schemas   But what to do if some schemas can be created in the future too?   I mean I want to grant read only permissions to these schemas (and tables in these schemans) created in the future without any additional configuration. Is it possible?
14945
I need to add a specific column if it does not exist. I have something like the following, but it always returns false:  IF EXISTS(SELECT *           FROM   INFORMATION_SCHEMA.COLUMNS           WHERE  TABLE_NAME = 'myTableName'                  AND COLUMN_NAME = 'myColumnName')    How can I check if a column exists in a table of the SQL Server database?
105318
I am using postgresql-9.2 . I have a table of products which stores the information about the products and its child table is content table , which contains the products linked to it.  PRODUCT MASTER TABLE  MASTER_ID                NAME   1                      PRODUCT1 2                      PRODUCT2 3                      PRODUCT3 4                      PRODUCT4 5                      PRODUCT5 6                      PRODUCT6 7                      PRODUCT7 8                      PRODUCT8 9                      PRODUCT9 10                     PRODUCT10   PRODUCT_CONTENT TABLE  PRODUCT_CONTENT_ID                     PRODUCT_MASTER_ID        CONTENT_ID A1                                          1                       2 A2                                          1                       3 A3                                          1                       4 A4                                          2                       3 A5                                          2                       4 A6                                          2                       5 A7                                          3                       5 A8                                          3                       7 A9                                          3                       8 A10                                         5                       8 A11                                         7                       9 A12                                         8                       10   I am writing a query to retrieve all the products(ids associated with them) with their content products which should display something like this hierarchy  MAINPRODUCT                     SUBPRODUCT     2                               3     2                               4     2                               5     3                               5     3                               7     3                               8     5                               8        7                               9     8                               10   I have written the following query   SELECT PM1.PRODUCT_MASTER_ID AS MAIN,PC.CONTENT_ID AS CONTENT     FROM PRODUCT_CONTENT PC      LEFT JOIN PRODUCT_MASTER PM ON PM.PRODUCT_MASTER_ID = PC.CONTENT_ID     LEFT JOIN PRODUCT_MASTER PM1 ON      PM1.PRODUCT_MASTER_ID = PC.PRODUCT_MASTER_ID     WHERE PC.PRODUCT_MASTER_ID IN        (        SELECT PC.CONTENT_ID FROM PRODUCT_CONTENT PC         LEFT JOIN PRODUCT_MASTER PM ON            PM.PRODUCT_MASTER_ID = PC.CONTENT_ID        LEFT JOIN PRODUCT_MASTER PM1 ON            PM1.PRODUCT_MASTER_ID = PC.PRODUCT_MASTER_ID        WHERE PC.PRODUCT_MASTER_ID IN ('1')       )   IT RETURNS SOMETHING LIKE THIS  MAIN            CONTENT  2                       3 2                       4 2                       5 3                       5 3                       7 3                       8
91878
I imported a bunch of tables from SQL Server 2000 to my 2008 database. All the imported tables are prefixed with my username eg: erpadmin.tablename.  In the table properties it lists 'erpadmin' as the db schema. When I write a query I now have to include 'erpadmin.' in front of all the table names which is confusing.  Current result:  select * from erpadmin.tablename   Desired result:  select * from  tablename
93847
I have several hundred (currently 466, but ever growing) tables I have to copy from one server to another.  I have never had to do this before, so I'm not sure at all on how to approach it. All the tables are in the same format: Cart&lt;Eight character customer number&gt;  This is part of a larger project of which I am merging all these Cart&lt;Number&gt; tables to one Carts table, but that's a whole different question altogether.  Does anyone have a best-practice method I can use to copy all these tables over? The database names on both servers are the same, if that helps. And as I said earlier, I have the sa account so I can do whatever is necessary to get the data from A to B. Both servers are in the same server farm, as well.
50956
I'm maintaining a database that is being shared by a few systems. Over the years a few of those systems have been deprecated and lots of the tables are actually orphaned. Is there a query I can run to find out which tables have not been used since a certain date?  Thanks.
61722
How do I dump the data, and only the data, not the schema, of some SQLite3 tables of a database (not all the tables)? The dump should be in SQL format, as it should be easily re-entered into the database later and should be done from the command line. Something like  sqlite3 db .dump   but without dumping the schema and selecting which tables to dump.
48923
When using JDBC, I often come across constructs like    ResultSet rs = ps.executeQuery(); while (rs.next()) {     int id = rs.getInt(1);     // Some other actions }   I asked myself (and authors of code too) why not to use labels for retrieving column values:    int id = rs.getInt("CUSTOMER_ID");   The best explanation I've heard is something concerning performance. But actually, does it make processing extremely fast? I don't believe so, though I have never performed measurements. Even if retrieving by label would be a bit slower, nevertheless, it provide better readability and flexibility, in my opinion. So could someone give me good explanation of avoiding to retrieve column values by column index instead of column label? What are pros and cons of both approaches (maybe, concerning certain DBMS)?
21180
I want to install scott schema, a sample database in oracle.  But in express edition, I can't find out it.  Please help me install it on Oracle 11g express.  I'm a newbie, pls help me
106310
Is there any table or any other way(metadata/rest api) we can query the list views of a particular object that a user/group  has access.  Example:  SELECT Name FROM table_x WHERE UserOrGroupId = '1234..' AND  SobjectType = 'Account'   I can see an object named UserListView in workbench, but query on that returns no data. Is it deprecated?