Re: Difficult query

2006-09-20 Thread Chris
Neil Tompkins wrote: Hi I've the following tables (holds a list of companies) TableName:Company CompanyID (int) CompanyName (varchar) (holds a list of areas) TableName:Area AreaID (int) AreaName (varchar) (holds a list of what areas are near to what companies), TableName:AreaCompany

Re: Difficult query

2006-09-20 Thread Jo�o C�ndido de Souza Neto
I´m not sure if i understood clearly. If you want to list the area and all of companies near it, you could do it: select a.AreaName as Area, group_concat(c.CompanyName) as Companys from AreaCompanys a_c, Area a, Company c where a_c.AreaID=a.AreaID and a_c.CompanyID=c.

Re: Difficult query and am kinda stuck how to continue can someone help?

2004-03-31 Thread Timon Berkowitz
I finally got it working like I wanted it :-) SELECT DISTINCT t1.softid, IF( t1.nameofcd LIKE '%test%' OR t2.nameofsoftware LIKE '%test%', t1.nameofcd, '') AS nameofcd, IF( t2.nameofsoftware LIKE '%test%', t2.nameofsoftware, '') AS nameofsoftware

Re: Difficult query and am kinda stuck how to continue can someone help?

2004-03-31 Thread Timon Berkowitz
You are totally right! "Harald Fuchs" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > In article <[EMAIL PROTECTED]>, > "Timon Berkowitz" <[EMAIL PROTECTED]> writes: > > > Hi there, > > Sorry for being a little bit confusing, but de criterias has to be AND. > > > So it has to be li

Re: Difficult query and am kinda stuck how to continue can someone help?

2004-03-30 Thread Timon Berkowitz
What I ment is this :-) Table1 consists out of the following fields and data +--++ | softid | nameofcd | +--++ | 1 | test cd 1 | | 2 | software cd 2 | | 3 | software cd 3 | | 4 | test cd 2 | +

Re: Difficult query and am kinda stuck how to continue can someone help?

2004-03-30 Thread Peter Brawley
To: [EMAIL PROTECTED] Sent: Tuesday, March 30, 2004 12:34 PM Subject: Re: Difficult query and am kinda stuck how to continue can someone help? Hi there, I have tried that query it works, but not good enough When you add in Table2 another row with softid 1 and without the string &#

Re: Difficult query and am kinda stuck how to continue can someone help?

2004-03-30 Thread Timon Berkowitz
matches the string 'test' > > so if your table2 had (6, 2, 'test'), where table1.nameofcd for softid=2 > does not contain 'test', do you want it in your result? > > PB > - Original Message - > From: Timon Berkowitz > To: [EMAIL PROTEC

Re: Difficult query and am kinda stuck how to continue can someone help?

2004-03-30 Thread Peter Brawley
s not contain 'test', do you want it in your result? PB - Original Message - From: Timon Berkowitz To: [EMAIL PROTECTED] Sent: Tuesday, March 30, 2004 12:34 PM Subject: Re: Difficult query and am kinda stuck how to continue can someone help? Hi there, I have

Re: Difficult query and am kinda stuck how to continue can someone help?

2004-03-30 Thread Timon Berkowitz
Hi there, I have tried that query it works, but not good enough When you add in Table2 another row with softid 1 and without the string 'test' in it like this : softid| nameofcd 1test cd 1 2utils cd 1 3test cd 2 4bac

Re: Difficult query

2002-11-04 Thread Michael T. Babcock
Alexander Newald wrote: I have a table with only ips in it. I want to get all networks the ips belong to: If you always use 24 bit netmasks, then the other solutions given should work just fine. If you're working with arbitrary sized networks though, you might want to store the IP addresse

Re: Difficult query

2002-11-04 Thread John Ragan
you might also try this: select substring(someField, 1, 6), count(substring(somefield,1,6 from theTable group by substring(someField, 1,6) i tried it in corereader and it seemed to do what you want. > Hello, > > I have a table with only ips in it. I want to get all networks the ips >

RE: Difficult query

2002-11-04 Thread Luc Foisy
Or, you could use distinct and substring_index instead of my last convoluted answer :) > -Original Message- > From: Kip Turk [mailto:kipt@;wcc.net] > Sent: Monday, November 04, 2002 4:17 PM > To: Alexander Newald > Cc: mySQL Mailing Liste > Subject: Re: Difficult query

Re: Difficult query

2002-11-04 Thread Kip Turk
On Mon, 4 Nov 2002, Alexander Newald wrote: > Hello, > > I have a table with only ips in it. I want to get all networks the ips > belong to: > > Example: > > 123.123.123.1 > 123.123.132.2 > 123.123.123.3 > 1.1.1.4 > 1.1.1.5 > 1.1.1.6 > 12.12.12.1 > 12.12.12.2 > 12.12.12.10 > > The result shoul

RE: difficult query help

2001-12-18 Thread Roger Baklund
* Henning Sprang > Now I want to create a query to get all task_id's which one given User > isn't already assigned to. I tried a lot of things, Joined in every > direction and so but do not come to my result. The problem in this situation is that you want to join with records that are not there.