independent tables

2011-05-02 Thread Rocio Gomez Escribano
Everyone has his/her own driving license, and I need to know what kind of
“person” (client or user) is.

 

 

mysql> select userID, clientID from client, user where
(clientCodeDrivingLicense= 321321321 || userCodeDrivingLicense = 321321321);

++---+

| userID | clientID |

++---+

|  1 | 2 |

|  2 | 2 |

|  3 | 2 |

|  4 | 2 |

|  5 | 2 |

++---+

5 rows in set (0.00 sec)

 

But, what I want is something like that:

 

 ++---+

 | userID | clientID |

 ++---+

 |  Null | 2 |

 ++---+

 

I tried something like this:

 

select COUNT(DISTINCT u.userID), userID, clientID from client, user  where
(clientCodeDrivingLicense = 321321321 || userCodeDrivingLicense =
321321321);

+--++---+

| COUNT(DISTINCT u.userID) | userID | clientID |

+--++---+

|5 |  1 | 2 |

+--++---+

1 row in set (0.00 sec)

 

But it wont be efficient enough in the future.

 

I suppose my solution is an Join, but they have no intersection, so, I cant
imagine how do it

 

Thank you!!

 

Regards

 

 

 

 

 

Rocío Gómez Escribano

  r.go...@ingenia-soluciones.com

 

Descripción: cid:image002.jpg@01CB8CB6.ADEBA830

Polígono Campollano C/F, nº21T

02007 Albacete (España)

Tlf:967-504-513  Fax: 967-504-513

www.ingenia-soluciones.com

 



Re: problem

2011-05-02 Thread Carlos Proal

Swaroop:

How are you handling the connections to db ? only one, with a pool, 
something adhoc ?.
It looks like the connection is only one and expires after a time out 
and you get the error that there is no connection.


Carlos

On 5/2/2011 3:15 PM, Andrés Tello wrote:

Seems more a java issue than a mysql issue... check for your parameters for
any keepalive or persostent option...

I think you wouldn't need to recompile just re-run or at leat, reboot the
server..



On Mon, May 2, 2011 at 2:34 AM, swaroop jois  wrote:


Hello friends, I have  MySQL server version  " 5.0.51a-Ubuntu"
  installed on Ubuntu 8.04 machine . I would describe briefly what we are
doing .
Basically we have built a server that listen to Gprs connection from client
  and accepts data in form packets and inserts that data
into MySQL database.I run three commands .1.listening to Gprs connection
and displaying all the received packets on the terminal.2.Number of packets
read will showed in Java serial forwarder (Tinyos for reference )which
listens on another port 3.command that invokes Java files  for inserting
data into database table .
Initially when i run the command  everything works fine and when he
  receive packets he is  able to insert data into table in MySQL database .

  He will still be listening on the port  (i.e he is running 24*7)Assume i
receive data after 12 hrs .i am experiencing the problem of .It may not
necessarily be 12 hrs .
  If i have to insert data again i have to  recompile the code again and run
all the commands .
The error that is troubling is Result for query failed.  SQLState = 08003i
googled the error and found that this Sqlstate indicates connection does not
exist .
I dont have any clues.Can any one help me please ?
Regards,Swaroop



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: problem

2011-05-02 Thread Andrés Tello
Seems more a java issue than a mysql issue... check for your parameters for
any keepalive or persostent option...

I think you wouldn't need to recompile just re-run or at leat, reboot the
server..



On Mon, May 2, 2011 at 2:34 AM, swaroop jois  wrote:

> Hello friends, I have  MySQL server version  " 5.0.51a-Ubuntu"
>  installed on Ubuntu 8.04 machine . I would describe briefly what we are
> doing .
> Basically we have built a server that listen to Gprs connection from client
>  and accepts data in form packets and inserts that data
> into MySQL database.I run three commands .1.listening to Gprs connection
> and displaying all the received packets on the terminal.2.Number of packets
> read will showed in Java serial forwarder (Tinyos for reference )which
> listens on another port 3.command that invokes Java files  for inserting
> data into database table .
> Initially when i run the command  everything works fine and when he
>  receive packets he is  able to insert data into table in MySQL database .
>
>  He will still be listening on the port  (i.e he is running 24*7)Assume i
> receive data after 12 hrs .i am experiencing the problem of .It may not
> necessarily be 12 hrs .
>  If i have to insert data again i have to  recompile the code again and run
> all the commands .
> The error that is troubling is Result for query failed.  SQLState = 08003i
> googled the error and found that this Sqlstate indicates connection does not
> exist .
> I dont have any clues.Can any one help me please ?
> Regards,Swaroop


design question

2011-05-02 Thread shawn wilson
i'm just looking for rough ideas here...

i've got a table that has 31 fields. most of them need to be there
(entry time, exit time, entry lat, etc). however, i've got 4 fields
that i query this db with that should generally be unique... well,
really 3 fields that should be unique, because the 'name' field is
what it sounds like - a spoken word - and two things can have the same
name.

so, i've got three other fields, two 'unsigned big int's and one
varchar(10) that's a callsign. all of these three fields should agree
with each other across entries this isn't always the case. there
are data abnormalities.

so, i'm curious of the best way to store and look this data up. my
first thought was just to have 4 separate tables with two fields - the
value and the unique id. however, sense i generally query these things
together, i thought that maybe they should all go into one separate
table with a uid that would differ for bad data types - those could
easily be found and dealt with.

my other thought was to have the separate tables and index the uid's
in the main table together?


i've got scripts that import this data. so, though i've got this data
in a db, i'm just going to rewrite my import script to use the new
schema. so, think of this as a new db with no data issues.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



RE: Join based upon LIKE

2011-05-02 Thread Jerry Schwartz
>-Original Message-
>From: Johan De Meersman [mailto:vegiv...@tuxera.be]
>Sent: Sunday, May 01, 2011 4:01 AM
>To: Jerry Schwartz
>Cc: Jim McNeely; mysql mailing list
>Subject: Re: Join based upon LIKE
>
>
>- Original Message -
>> From: "Jerry Schwartz" 
>>
>> I shove those modified titles into a table and do a JOIN ON
>> `prod_title` LIKE
>> `wild_title`.
>
>Roughly what I meant with the shadow fields, yes - keep your own set of data
>around :-)
>
>I have little more to offer, then, I'm afraid. The soundex() algorithm may or
>may not be of some use to you; it offers comparison based (roughly) on
>pronounciation instead of spelling.
>
[JS] I've thought about using soundex(), but I'm not quite sure how.

I didn't pursue it much because there are so many odd terms such as chemical 
names, but perhaps I should give it a try in my infinite free time.

>Apart from that, you have my deepest sympathy. I hope you can wake up from 
>the
>nightmare soon :-)
>
[JS] Thanks for your condolences.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: je...@gii.co.jp
Web site: www.the-infoshop.com



>--
>Bier met grenadyn
>Is als mosterd by den wyn
>Sy die't drinkt, is eene kwezel
>Hy die't drinkt, is ras een ezel




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



problem

2011-05-02 Thread swaroop jois
Hello friends, I have  MySQL server version  " 5.0.51a-Ubuntu"  installed on 
Ubuntu 8.04 machine . I would describe briefly what we are doing .
Basically we have built a server that listen to Gprs connection from client  
and accepts data in form packets and inserts that data into MySQL database.I 
run three commands .1.listening to Gprs connection and displaying all the 
received packets on the terminal.2.Number of packets read will showed 
in Java serial forwarder (Tinyos for reference )which listens on another 
port 3.command that invokes Java files  for inserting data into database table .
Initially when i run the command  everything works fine and when he  receive 
packets he is  able to insert data into table in MySQL database .

 He will still be listening on the port  (i.e he is running 24*7)Assume i 
receive data after 12 hrs .i am experiencing the problem of .It may not 
necessarily be 12 hrs .
 If i have to insert data again i have to  recompile the code again and run all 
the commands .
The error that is troubling is Result for query failed.  SQLState = 08003i 
googled the error and found that this Sqlstate indicates connection does not 
exist .
I dont have any clues.Can any one help me please ?
Regards,Swaroop