the above query fetches records as
1 testing D
2 upload H
i have to display my third column with full description which is stored in another table as select descr from app where code = application; I have to display this descr in the above result set instead of D,H.
i have created a table called table2,with only one column as text,
SQL> select regexp_replace(text,'[:]',chr(10)) text from table2;
TEXT -------------------------------------------------------------------------------- 1 amar 11-jan-2011 15000
2 manju 22-feb-2011 20000 and i have to get output like this, TEXT -------------------------------------------------------------------------------- ID 1 NAME amar DATEOFJOINING 11-jan-2011 SALARY 150000
for functions like SDO_GEOM.RELATE, do the return values like "COVEREDBY", are those values/definitions defined in the database somewhere? For instance a table containing all the values and a description of each?
how to write a single query, Also i may add /delete school/class anytime. Query should support mesans everything dynamically should get the data.Even stored procedure will work for me.
As far as SQL is concerned, I am using oracle 9i and oracle sql *plus.
1. This is a table 'spj' SID PID JID QTY ---------- ---------- ---------- ---------- 1 3 2 5 1 2 2 12 1 7 1 10 2 5 3 5
[code]...
I wish to count all the qty for each pid.This is what I have: SQL> select pid,sum(qty) from spj group by pid; PID SUM(QTY) ---------- ---------- 1 5 2 12 3 29 4 10 5 5 6 6 7 10
and it seems to work fine. But I now I want to display another column in the table called 'pname' which is a primary key in another table 'p'. 'spj.pid' is the foreign key.
2. Another query I can't perform needs the table s SID SNAME STATUS CITY ---------- -------------------- -------------------- ------------------- 1 s1 y asansol 2 s2 y durgapur 3 s3 y durgapur 4 s4 y asansol 5 s5 y kolkata 6 s6 y asansol 7 s7 y tarakeshwar
the question says:
Quote: List supplier names(snames) who supply at least all parts supplied by supplier(sname) S2.
QUOTE (thiyagusham @ Mar 27 2012, 11:40 PM) SQL> select * from samp;
NAME DOJ QUAL EMPID ---------- --------------- ---------- ----- sam 21-mar-2012 mca sony 03-jan-2000 mba 10610 maya 21-mar-2012 m.arch sonna 18-mar-2012 mis
[code]...
i want to display in result column 10610 in second row , because emp sony having id "10610 "should i use sub-query ? without sub-query how can i display ?
I'm using the Oracle Emp,Dept tables as my sample. I want to display certain table column values based on some criteria. If met, display those values otherwise display other column values
For example:
So when dept.deptno=10, I want to display these 2 columns values 1. dept.deptno 2. dept.dname
otherwise, display these 2 columns values 1. dept.loc 2. null
Can this be done with one case, decode or "other" type of structure going thru the table one time??
SELECT emp.empno, emp.ename, CASE WHEN dept.deptno = 10 THEN to_char(dept.deptno) [code].......
I have created a query that display the difference in the tables and column of two users. Some of the column in the new user have been added new which were not there in the old user and some columns from the old user still exits but their data_type is changed.
Now I want to select one more column in the select statement specifying whether the column is modified or has been added.
SELECT TABLE_NAME,COLUMN_NAME,DATA_TYPE,DATA_LENGTH FROM DBA_TAB_COLUMNS WHERE OWNER = 'ABC' AND TABLE_NAME NOT IN (SELECT table_name FROM all_tables where owner = 'ABC' MINUS SELECT table_name FROM all_tables where owner = 'XYZ' ) MINUS SELECT TABLE_NAME,COLUMN_NAME,DATA_TYPE,DATA_LENGTH FROM DBA_TAB_COLUMNS WHERE OWNER = 'XYZ' [code]....
TABLE_A ------------------------------ ID DEPT CRS ------------------------------ 1 CS CS_100 2 SCIENCE SCI_150 3 MATH MATH_400 4 HISTORY HIS_110
[Code]...
To display CRS from TABLE_A where DEPT = 'MATH' but in the following format.,
-------------------------------------------- NO DEPT CRS -------------------------------------------- 1 MATH MATH_400, MATH_550, MATH_230 --------------------------------------------
instead of., -------------------------- NO DEPT CRS --------------------------- 1 MATH MATH_400 2 MATH MATH_550 3 MATH MATH_230 ---------------------------
AREA (area_code, area_name) MONTHLY_SALES (area_code, isbn, book_name, qty, sales_amount)
I want to display the output of top 3 sales columnwise as below.
AREA_NAME Top 1st (ISBN) Top 1st (BOOK_NAME) Top 1st (QTY) Top 2nd (ISBN) Top 2nd (BOOK_NAME) Top 2nd (QTY) Top 3rd (ISBN) Top 3rd (BOOK_NAME) Top 3rd (QTY)
I have created ".sql" script in Unix and I am trying to execute the script at SQL prompt. But I am getting the following error message after getting the output.
ORA-02019: connection description for remote database not found
Disconnected from Oracle Database 10g Enterprise Edition
Release 10.2.0.3.0 - 64bit Production With the Partitioning, OLAP and Data Mining options
The table has single column & the values may differ,that is, they may have 1-2-3-...-n in a single row, but the desired output is to be in the rows as shown above.
I tried concepts of SQL up to my knowledge, but I failed. The query to be done only in SQL.complete this query.
03-AUG-10> set pages 0 03-AUG-10> set heading on 03-AUG-10> select count(*) numberofrows 2 from iceberg_mig_acnts_stage2 s2, tvp109workorder t109 3 where s2.no_account = t109.no_account
How I can build a query with conditions and calculations? E.g. I've got this table
Start | End | Working Place | Mandatory ------------------------------------------------------------------------------------ 01-JAN-13 | 11-JAN-13 | Office | 1 14-JAN-13 | 25-JAN-13 | Home Office | 0 04-MRZ-13| 15-MRZ-13 | Office | 0 11-FEB-13 | 22-FEB-13 | Office | 1
Now if column working place=Office and column mandatory=0 the new column "price" has to calculate: (End-Start)* $25.00 and if working place=Office and column mandatory=1 the "price" column has to calculate: (End-Start)* $20.60 else $0.00
I tried it with the case statement but I didn't know how to calculate my values and display it to the virtual column "price".
Something like case when Working_Place = 'Office' and Mandatory=1 then ... else '0.00' end as PRICE ?????
I am trying to only display a column value one time for a record, not a static value. The value changes and there can be many values. I do not think grouping will work since the Date value is dynamic. I am using Oracle for Toad 10.5. There are 4 records with this test data.
select Date, Person, Language, Country from TableATableA Date Person Language Country 01/25/2013 James English 12/20/2012 James English US
I dont want to print the repeated value(NAME) of C1 multiple times as below.
C1C2C3C4 NAMEJOHN10ABC SMITH30DEF ROBERT60XYZ
I could do it using the below query using union with the rownum.
select * from ( select rownum rn, c1,c2,c3,c4 from table_new ) where rn =1 union select * from ( select rownum rn, decode(c1,null,null),c2,c3,c4 from table_new ) where rn between 2 and 3
Is there any other way of displaying using a single sql query.
I have a blob column in one table. I need to show it in my form (6i). If i put an image file in the column, it works (because i show it in a Image item type) but if i put a text file in the blob column, it does n´t work.
I have a table named PRODUCT (ID Number , ProductImage BLOB). I have inserted some records in. I want to create a form for user to view this table.
When I create Data Block, in Data Block Wizard, if I select option 'Table or View' to retrieve data, it's ok (Data type of item ProductImage is Image, when I run form and query, it display image normally).BUT, I want to retrieve data from stored procedure in a package. This is my package
PACKAGE my_pkg IS TYPE my_rec IS RECORD ( myID PRODUCT.ID%TYPE, myImage PRODUCT.ProductImage%TYPE );
[code].....
I select option 'Stored Procedure' in Data Block Wizard, then select my stored procedure (my_pkg.Do_Query). Next I choose 2 columns from my stored procedure (ID, ProductImage). The wizard still applys data type of ProductImage as Image. I finish Data Block Wizard and Layout Wizard... run form, query and an error message display:
FRM-40364: The data type of item 'ProductImage' does not match the corresponding column in the stored procedure.
I try to change 'myImage PRODUCT.ProductImage%TYPE' -> 'myImage BLOB' in my package but still get that error.