What is PL/SQL table? SNO MARK ------- ------------------1 592 403 ‘A’4 60 Write a single query to I) Sorted Marks II)First mark III) replace the mark ‘A’ with 0(zero)?

Showing Answers 1 - 23 of 23 Answers

gayu_rec

  • Feb 8th, 2006
 

Pl/Sql table is a type of datatype in procedural language Extension.It has two columns.One for the index,say Binary index And another column for the datas,which might further extend to any number of rows (not columns)in future.

RitHas

  • Feb 22nd, 2006
 

I)sort marksSelect * form TABLE order by MARK;II)First Markhighest mark or first mark in table.Highest: Select Max(Mark) from TABLE;First: Select Mark from TABLE where rownum = 1III)replace mark 'A' with 0(zero)update TABLE set MARK = 0 where MARK = 'A';

passtosekar

  • Jul 2nd, 2007
 

SELECT MAX(TO_NUMBER(MARK1)) FROM (SELECT CASE WHEN MARKS BETWEEN 'A' AND 'Z' THEN '0' ELSE MARKS END MARK1 FROM STUDENT)

matt prince Saker Ltd

  • Sep 12th, 2007
 

A PL/SQL table is a sparse array of values indexed by an integer. This differs from the traditional array in C or other such languages in that the rows only exist once a value has been assigned to them. Reading from an unassigned index point will give a no data found exception.

g_sidhu

  • Feb 16th, 2008
 

PL/SQL tables are singly dimensioned, unbounded, sparse collections of homogeneous elements and are available only in PL/SQL. These are now called index−by tables.  Relational tables are easily related to other relational tables. If the data may be related to many other tables, then it may be best not to nest the data within one table. Storing it in its own table will give you the greatest flexibility in managing the data relationships. Can be indexed.

aichu1604

  • Apr 1st, 2009
 

We can use an inline view to achieve this..

SELECT sno,x
FROM (select sno,decode(mark,`A`,0,to_number(mark)) x from sort_marks) xt
ORDER BY x;

  Was this answer useful?  Yes

samareshp

  • Apr 15th, 2009
 

I guess the the question should be replace a with zero then sort the mark and
then show first mark, Let me know if i am wrong.


select max(mark)
from (
SELECT sno, mark
FROM (select sno, decode(mark, 'A', 0, mark) x from t) xt
ORDER BY x
)


  Was this answer useful?  Yes

NehaChanda

  • May 22nd, 2009
 

We can not use MAX on PLSQL table. Check if it works.

Create a PLSQL Table Sorted_Mark.

SNO_MARK(3) := 0; - Replace A

Sorted in another Collection Type
select culumn_value
bulk collect into Sorted_MARK
from table (cast(SNO_MARK as PLSQL_DATATYPE))
order by column_value

Sorted_MARK(1) - First Value

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions