ALLInterview.com :: Home Page
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   Errors
   Testimonials Refer this Site  Refer This Site to Your Friends  Site Map  Contact Us      
   
 
 Categories >> Software >> Databases >> SQL PLSQL
 
Suggest New Category 
 


 

Question Asked @ Answers Views     Select
What is nvl function? cap-gemini   4  4154
there is A table and B table in A table there 5 rows and in b table there are 2 rows i am firing query select * from a,b what will be the output? cognizent   7  5783
why we go for package? what are the advantages of using instead of seperate procuderes or functions tcs   3  3955
I have a package in which a table was used in a procedure and compiled later i have dropped the table used in the package what would be the status of package specification and body tcs   1  2732
How to create a view on a table which does not exists tcs   4  8445
SQL Tuning, Oracle Server 10g: Why is the following hint invalid? SELECT /*+ first_rows parallel(table_name,paral_number)*/ accenture   1  4161
1. what is the exact use of hint in sql. 2. How we can avoid index scan in sql even though index is there in the table. polaris   1  3327
what is difference between decode and case function?    2  4745
what is External tables? explain with examples tcs   2  5215
What is bulk collections?    1  3271
IF THERE ARE 1 TO 100 NUMBERS IN A TABLE AND IN THAT 100 NUMBERS SOME 10 NUMBERS ARE DELETED.I WANT TO FIND OUT THE MISSING NUMBERS BETWEEN 1 TO 100 by PL/SQL HOW?    7  4216
Hi all, I am going to write oracle certification. Can anyone send me the dumps available if any for OCA exam? Its really very urgent, prompt response will help me alot..    8  2385
What are Anti joins ibm   1  5311
What are Global Temporary tables ibm   3  4691
What are Nested Tables? How will u delete 5 rows from Nested Tables ibm   3  4305
E-Mail New Answers        Answer Selected Questions        Post New sql-plsql Questions
Prev    1   ... 5   ... 9   ... 13    16   [17]    18  ... 21   ... 25   ... 29   ... 33   ... 37   ... 41   ... 45   ... 49   ... 53    Next
 
 
 
 
 
Un-Answered Questions
 
 Question Views   Select
 
Hi, I am new in oracle(SQL), could anyone help me in writing a correct SQL. Below is the table structure. Table: Subsc Fields: 1. Sub_no (this field will hold values of subscriber nos, for e.g. S111111, S222222, S333333, S444444, etc.) 2. s_status (this field will hold values for different status of subscriber, for e.g. 'A', 'S', 'C', etc.) 3. cus_id (this field will hold values of bill nos for e.g. 11111111, 22222222, 33333333, 44444444, etc.) Table: Bill Fields: 1. Bill_no this field will hold values of bill nos for e.g. 11111111, 22222222, 33333333, 44444444, etc.) 2. b_status = (this field will hold values for different status of bill for e.g. 'O', 'C', 'S', etc.) Note: 1. The Sub_no is a Primary key of Subsc table. 2. The cus_id is a foreign in Subsc table (referred from Bill_no field of Bill table) 3. The Bill_no field is the Primary key of Bill table. Query A --> I wrote a query to select cus_id/Bill_no which is in status open (b_status = 'O') and having more than two active subscriber (i.e. S_status = 'A') in it ( i.e. more the two subscribers in same bill). select s.cus_id from subsc s where exists (select 1 from bill where bill_no = s.cus_id and b_status = 'O') and s_status = 'A' group by s.cus_id having count(sub_no) = 2 Problem : The above query will give the cus_id (or rather bill_no) which are in open status (b_status ='O) and which are having TWO ACTIVE Subscribers (s_status ='A') in it. However, this query will also lists the cus_id/bill_no which are having more than TWO subscribers in it (but only two subscriber will be in Active status (s_status = 'A') and the others will be in s_status = 'C' or s_status = 'S'. Help needed: I want to write a query which will fetch ONLY the cus_id/bill_no which are in open status (b_status ='O') and which are having ONLY TWO ACTIVE subscribers (s_status ='A') in it. B--> If I include the sub_no in the above query then NO row are returned. select s.cus_id, s.sub_no from subsc s where exists (select 1 from bill where bill_no = s.cus_id and b_status = 'O') and s_status = 'A' group by s.cus_id, s.sub_no having count(sub_no) = 2 Help needed: I want to modify the above query which will fetch ONLY the cus_id/bill_no which are in open status (b_status ='O') and which are having ONLY TWO ACTIVE subscribers (s_status ='A') in it ALONG with the sub_no. Thanks a lot in advance. Regards, Nitin 475
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10 557
What is window clause? 116
What are code pages ? 554
Could you please provide oca (oracle 10g) dumps for my certification ? 2232
what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details? 768
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me 455
write a query that returns first characters of each word in Oracel/Sql pl sql 3962
what is the bond code in materialized view? 989
1. is it possible to use the cursor atttibutes (%found ,% rowcount , %isopen , %notfound ) to our user defined cursor names ....... cursor cursor_name is select * from scott.emp if you use... cursor_name%found , %rowcount ,%isopen,%notfound...will it work... -------------------------- 2.what is the difference between the varray and index by table .. -------- 3. type type_name is table of number(8,3) index by binary_integer; identifier_name type_name; first , last , prior , next ,trim are the methods we can use it for the above type...simillary is there any way to apply for cursors... with thanks and regards..sarao... 556
hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews 305
what is single byte over head in oracle..? 646
what is the difference between trigger and constraint? 2062
What are wait events. Describe the wait event tables. 1853
What is Materialized View? In What Scenario we Use Materialized View? 3870
E-Mail New Answers        Answer Selected Questions