how to find the First and Last Observation from the table:
Ex: OBS Name Sal Ans like: OBS Name Sal
105 E 5000--> 105 E 5000
102 B 2000 104 D 4000
103 C 3000
101 A 1000-->
104 D 4000
Answers were Sorted based on User's Feedback
Answer / shailesh jori
select * from table_name where rowid=(select min(rowid) from table_name) or rowid=(select max(rowid) from table_name)
Is This Answer Correct ? | 5 Yes | 3 No |
Answer / ajit
SELECT MIN(Obs)
FROM <Table_name>
UNION ALL
SELECT MAX(Obs)
from <Table_name>;
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / mahendar reddy
select *from t_name where rownum=1
union
(select *from t_name
intersect
select *from t_name where rowid=(select max(rowid)from t-name));
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / arjun
select * from tablename where rowid=1
union
( select * from tablename
intersect
select * from tablename where rowid = ( select max(rowid)
from tablename));
Is This Answer Correct ? | 0 Yes | 6 No |
how to get @@error and @@rowcount at the same time? : Sql dba
Can you sum a count in sql?
What is sp_helptext?
What is bulk collections?
table :- city name country code abc 11 bcd 22 cde 232 def 33 write a procedure , so that when we give a phone no. eg - 1123456789 - o/p sud be city name = abc if phone no. - 2322345897 , o/p sud be =cde note - bcd and cde city name sud be diff. as dey diff only with th last no. Pls ans. this questnion.
What is #table in sql?
What are tables in sql?
How do I edit a stored procedure?
What has stored procedures in sql and how we can use it?
how can we know the number of days between two given dates using mysql? : Sql dba
Which one of the following join types will always create a Cartesian Product? 1. CROSS JOIN 2. LEFT OUTER JOIN 3. RIGHT OUTER JOIN 4. FULL OUTER JOIN 5. INNER JOIN
what are all the different types of indexes? : Sql dba