Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ashutosh011283
Starting Member
6 Posts |
Posted - 2011-08-05 : 01:56:29
|
| HI All,Que:- I have two tables Users & Friends,there are lots of record in both tables as per below detailsTable1 (Users) ID(FK) Name GenderTable2 (Friends) ID(PK) professionI would like to know - find more than 50 records from the tables with Name,profession and gender= female only Please give me response ASAP.....ashutosh upadhyay |
|
|
flamblaster
Constraint Violating Yak Guru
384 Posts |
Posted - 2011-08-05 : 01:59:42
|
| ashutosh, just one question. If there are less than 50 records, do you not want to return any values? So for example, if there are only 49 records, would you show 0 records? |
 |
|
|
ashutosh011283
Starting Member
6 Posts |
Posted - 2011-08-05 : 02:11:04
|
| yes exactlyashutosh upadhyay |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-08-05 : 02:18:44
|
quote: Originally posted by ashutosh011283 yes exactlyashutosh upadhyay
can you explain further ? If you have only 49 records what to show for the 50th record ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
flamblaster
Constraint Violating Yak Guru
384 Posts |
Posted - 2011-08-05 : 02:30:49
|
| Any chance you could run the following queries against your data and post the results:Select 'insert into users (id, name, gender) values ('+convert(varchar(10), id)+','+name+','+gender+');'From UsersSelect 'insert into friends (id, profession) values('+convert(varchar(10), id)+','+profession+');'From FriendsThis way we can get some sample data to insert and provide results |
 |
|
|
|
|
|
|
|