![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| I have a query problem. There can be dupes in machine - no problem There can be dupes in owner - no problem but I like to find out whether there are machine dupes of the same owner this are the contents of the table owner,machine -------------------- michael,car brad,car jeniffer,laptop john,car john,car john,laptop brad,laptop I like to do a query to john with result: car If i do the same to brad I get an empty result. Can anybody help please me with this? Thanks in advance | |||
| Advertisements |
| | #2 | ||
| Jaak wrote: > I have a query problem. > > There can be dupes in machine - no problem > There can be dupes in owner - no problem > > but I like to find out whether there are machine dupes of the same owner > > this are the contents of the table > > owner,machine > -------------------- > michael,car > brad,car > jeniffer,laptop > john,car > john,car > john,laptop > brad,laptop > > > I like to do a query to john with result: > car > > If i do the same to brad I get an empty result. > > Can anybody help please me with this? Something like this? SELECT count(*), owner, machine FROM table1 group by owner, machine -- Justin Koivisto, ZCE - justin@koivi.com http://koivi.com | |||
| | #3 | ||
| "Justin Koivisto" <justin@koivi.com> schreef in bericht news:rradnZ8mEsFRbF_eRVn-hA@onvoy.com... > Jaak wrote: >> I have a query problem. >> >> There can be dupes in machine - no problem >> There can be dupes in owner - no problem >> >> but I like to find out whether there are machine dupes of the same owner >> >> this are the contents of the table >> >> owner,machine >> -------------------- >> michael,car >> brad,car >> jeniffer,laptop >> john,car >> john,car >> john,laptop >> brad,laptop >> >> >> I like to do a query to john with result: >> car >> >> If i do the same to brad I get an empty result. >> >> Can anybody help please me with this? > > Something like this? > > SELECT count(*), owner, machine FROM table1 group by owner, machine No, its intended for finding out wheter there are duplicate records so I can delete them afterwards | |||
| | #4 | ||
| Jaak wrote: > I have a query problem. > > There can be dupes in machine - no problem > There can be dupes in owner - no problem > > but I like to find out whether there are machine dupes of the same owner > > this are the contents of the table > > owner,machine > -------------------- > michael,car > brad,car > jeniffer,laptop > john,car > john,car > john,laptop > brad,laptop > > > I like to do a query to john with result: > car > > If i do the same to brad I get an empty result. > > Can anybody help please me with this? > > Thanks in advance > > > Try a 2 field index? | |||
| Featured Websites | ||||
|
![]() |
| Tags: dupes, nested |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| i will find drivers for you | md | Operating Systems And Software | 1 | 08-16-2007 7:24 PM |
| Something you might find useful... | RØØNE¥ | Ebay Technical Questions | 1 | 05-31-2007 12:38 AM |
| Can't find the right bios for our PC. Help us please. | Loek | Operating Systems And Software | 1 | 05-29-2007 12:51 AM |
| DB_NestedSet, where did my nested set go? | Daniel Khan | Pear | 0 | 05-20-2007 6:34 PM |
| 'nested conditional' that can identify parent page? | Alan Jones | PHP | 8 | 05-20-2007 6:33 PM |
| Featured Websites | ||||
|