How to select the all first rows which are having same id.for example:id name salary11. suresh 1000011. suresh 1200012. rajesh 1200012. rajesh 13000now i want to get rows as below given format11. suresh 1000012. rajesh 12000

Showing Answers 1 - 11 of 11 Answers

suresh

  • Jun 21st, 2006
 

select distinct id,name,salary from (give the table name here);

  Was this answer useful?  Yes

Bapi

  • Jun 29th, 2006
 

You need to take rowid into account. you can try the below query.

Select id, name, sal from emp where rowid in select min(rowid) from emp group by id;

  Was this answer useful?  Yes

rabbi

  • Jul 3rd, 2006
 

Table Name is TEST
The SQL can be.....

select avg(id), name, min(salary) from test group by name

  Was this answer useful?  Yes

Sarfaraz Ahmad Khan

  • Jul 18th, 2006
 

select id,name,salary from <tablename> where rowid not in(seelct max(rowid) from <tablename> group by id)

  Was this answer useful?  Yes

dev

  • Sep 13th, 2006
 

SQL> select min(id),name,min(salary) from xyz group by name;

  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