Hi,
Can anyone give me solution for these question:
IS there any way we can retrieve alternate rows in a table(1,3,5,...)?
What is the maximum number of triggers we can write on a table?
Thanks All in advance
Anupama
Printable View
Hi,
Can anyone give me solution for these question:
IS there any way we can retrieve alternate rows in a table(1,3,5,...)?
What is the maximum number of triggers we can write on a table?
Thanks All in advance
Anupama
What are those 1,3,5,... values? If they are for example values from some column (like sequence generated keys), you can us this:Quote:
Originally posted by anupamasuresh
IS there any way we can retrieve alternate rows in a table(1,3,5,...)?
SELECT * FROM my_table
WHERE MOD(my_column, 2) = 1;
If on the other hand you simply would like to display every other record that is otherwise returned by the query, you can use this:
SELECT * FROM
(SELECT ROWNUM rn, x.* FROM my_table x)
WHERE MOD(rn, 2) = 1;
Don't think there is a limit on this (at least not a practical one).Quote:
What is the maximum number of triggers we can write on a table?
1) something like:
2) since you can't determine the sequence of triggers firing, I'd prefer one trigger which calls a heap of procedures.Code:select * from
(select a.*, Rownum row_number
from my_table a)
where mod(row_number,2)=1