Prepare for your Next Interview
This is a discussion on SQL query within the SQL forums, part of the Databases category; Hi All, Need a help to solve the query, infact i am actually beginner to SQL. Two tables one with Emp and other Address table. They look similiar to like ...
|
|||
|
SQL query
Hi All,
Need a help to solve the query, infact i am actually beginner to SQL. Two tables one with Emp and other Address table. They look similiar to like this Emp has two rows Empid Ename 12 Scott 13 Tiger 14 Eagle Address has two rows Empid Add 12 Boston 13 Arizona 14 Boston I need to list all the empid and ename whose address are same. Thanks regards Prakash |
| The Following User Says Thank You to prakash.kudrekar For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: SQL query
Quote:
Empid Ename 12 Scott 13 Tiger 14 Eagle Here empid and ename are columns In Emp table you have three rows and two columns. The query is Select a.empid, a.ename,b.add from emp a, address b where a.empid = b.empid |
|
|||
|
Quote:
Dude this query would print all the rows since all employee ids wud be present in address table aganist to emp table |
|
|||
|
Re: SQL query
Quote:
and b.add in ( Here write query to return address having count(add)>1) Last edited by krishnaindia2007 : 07-30-2008 at 10:04 AM. |
|
|||
|
Re: SQL query
Quote:
From where you are getting these 40000 rows? |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sql query help | kothojubhaskar | SQL | 3 | 09-13-2008 02:53 AM |
| How to get this o/p from the sql query | bhaski | SQL | 4 | 06-21-2008 02:27 AM |
| SQL query.. | prafulkr | SQL | 2 | 02-14-2008 06:14 AM |
| sql query help... | psuresh1982 | SQL | 6 | 07-23-2007 01:55 AM |
| regarding sql query | psuresh1982 | SQL | 8 | 07-13-2007 04:20 AM |