Re: where may I find sqlplus.hh?

2006-08-03 Thread Chris

nayak_ratnadeep wrote:
 
I found in net but can't get the file. please help me..


Always reply to the list.

Here's a hint: look for "C++ API" in the documentation.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: where may I find sqlplus.hh?

2006-08-03 Thread Chris

nayak_ratnadeep wrote:
  
Hello,

  I have downloaded a code on c++ to talk to MySQL database from net which
included a file "sqlplus.hh" , where may I find the file?Please help me
soon.


Why have you posted this 5 times?

Did you look at the mysql website at ALL?

It took me 30 seconds to find it.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



where may I find sqlplus.hh?

2006-08-03 Thread nayak_ratnadeep
  
Hello,
  I have downloaded a code on c++ to talk to MySQL database from net which
included a file "sqlplus.hh" , where may I find the file?Please help me
soon.
  With Regards.
Ratnadeep Nayak.


Re: How do I find all the users that are new since my last login

2006-08-03 Thread Ligaya Turmelle

Daevid Vincent wrote:

I have a SQL challenge I'm not sure how to solve. But it's so common, I feel
kind of stupid asking this...

I have a 'user' table with 'login_date' which is an auto updated DATETIME
column and a 'created_on' which is a DATETIME (but not updated after the
record is created the first time)

I want to show a list of users who are new since my last login. But the
problem is that my last login changes for every page load (i.e. it is
updated so that I can guestimate if a user is logged in still or not... I
consider 10m to be the window, since rarely do users ever officially
'logout').

So I think I need to have a SQL query that only deals with the date, not the
mins/secs? I'm just not sure the optimum way to do this.

The other challenging part seems to me that as soon as 'login_date' is
updated, then everyone that was 'new' is now 'old' because the login_date
just got updated right? I kinda want the 'new' user status to persist for
the whole session [or maybe even the whole day (that is, I could logout/in
and those people would still show as new) -- but I can live with just being
new for the session]

How is this sort of thing usually handled? Do I need another column that
isn't auto-updated and that just get's set upon each new 'login' session?
Unlike a "message board" or web based "email" system, I CAN'T flag each user
as viewed or something like that. This feature is for a "network" type
scenario where a user can see new users added to their network of friends
since the last time they logged in. Or so the Administrators can see all new
users. This type of thing.

And what is the optimal SQL incantation to deal with just the date portions
and ignore the hh:mm:ss part?

ÐÆ5ÏÐ 




DATE() - or maybe DATE_FORMAT() if you want a specific format

--

life is a game... so have fun.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

where may I find sqlplus.hh??

2006-08-03 Thread Ratnadeep Nayak

Hello,
 I have downloaded a code on c++ to talk to MySQL database from net which
included a file "sqlplus.hh" , where may I find the file?Please help me
soon.
 With Regards.
Ratnadeep Nayak.


Where may I find sqlplus.hh

2006-08-03 Thread Ratnadeep Nayak

Hello,
  I have downloaded a code on c++ to talk to MySQL database from net which
included a file "sqlplus.hh" , where may I find the file?Please help me
soon.
  With Regards.
Ratnadeep Nayak.


How do I find all the users that are new since my last login

2006-08-03 Thread Daevid Vincent
I have a SQL challenge I'm not sure how to solve. But it's so common, I feel
kind of stupid asking this...

I have a 'user' table with 'login_date' which is an auto updated DATETIME
column and a 'created_on' which is a DATETIME (but not updated after the
record is created the first time)

I want to show a list of users who are new since my last login. But the
problem is that my last login changes for every page load (i.e. it is
updated so that I can guestimate if a user is logged in still or not... I
consider 10m to be the window, since rarely do users ever officially
'logout').

So I think I need to have a SQL query that only deals with the date, not the
mins/secs? I'm just not sure the optimum way to do this.

The other challenging part seems to me that as soon as 'login_date' is
updated, then everyone that was 'new' is now 'old' because the login_date
just got updated right? I kinda want the 'new' user status to persist for
the whole session [or maybe even the whole day (that is, I could logout/in
and those people would still show as new) -- but I can live with just being
new for the session]

How is this sort of thing usually handled? Do I need another column that
isn't auto-updated and that just get's set upon each new 'login' session?
Unlike a "message board" or web based "email" system, I CAN'T flag each user
as viewed or something like that. This feature is for a "network" type
scenario where a user can see new users added to their network of friends
since the last time they logged in. Or so the Administrators can see all new
users. This type of thing.

And what is the optimal SQL incantation to deal with just the date portions
and ignore the hh:mm:ss part?

ÐÆ5ÏÐ 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Where may I find sqlplus.hh

2006-08-03 Thread Ratnadeep Nayak

Hello,
  I have downloaded a code on c++ to talk to MySQL database from net which
included a file "sqlplus.hh" , where may I find the file?Please help me
soon.
  With Regards.
Ratnadeep Nayak.


RE: I have 972 vmware-bin.000XXX files!

2006-08-03 Thread Logan, David (SST - Adelaide)
Hi Daevid,

There are the binary logs. Yes they are used for replication or you can use 
them much the same as a logical log exists in some other technologies.

You can find a good description of them at the mysql manual website at : 

http://dev.mysql.com/doc/refman/5.0/en/binary-log.html 

Regards


---
** _/ **  David Logan 
***   _/ ***  ITO Delivery Specialist - Database
*_/*  Hewlett-Packard Australia Ltd
_/_/_/  _/_/_/    E-Mail: [EMAIL PROTECTED]
   _/  _/  _/  _/     Desk:   +618 8408 4273
  _/  _/  _/_/_/  Mobile: 0417 268 665
*_/   **
**  _/    Postal: 148 Frome Street,
   _/ **  Adelaide SA 5001
  Australia 
invent   
---

-Original Message-
From: Daevid Vincent [mailto:[EMAIL PROTECTED] 
Sent: Friday, 4 August 2006 12:43 PM
To: mysql@lists.mysql.com
Subject: I have 972 vmware-bin.000XXX files!

I use a VMware for LAMP development work. 

I just looked in my /var/lib/mysql dir and there are 972 of these
vmware-bin.01 ... vmware-bin.000972 files! Yipes!

Do I need them? Can I delete them? How do I prevent them from being created
all the time?

Can't they all just go into one vmware-bin file (as in append, like a .log
file does)?

I saw this post, but it doesn't answer any questions:
http://forums.mysql.com/read.php?28,74385,74385

Googling for 'mysql bin.01' seems to indicate these are related to
replication -- I'm not using replication.

ÐÆ5ÏÐ 

P.S. I found this link:
http://miniprep.caltech.edu/~remote/blog/?p=99
Which says to run "reset master;" -- which did get rid of them for now, but
my questions above are still valid.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



I have 972 vmware-bin.000XXX files!

2006-08-03 Thread Daevid Vincent
I use a VMware for LAMP development work. 

I just looked in my /var/lib/mysql dir and there are 972 of these
vmware-bin.01 ... vmware-bin.000972 files! Yipes!

Do I need them? Can I delete them? How do I prevent them from being created
all the time?

Can't they all just go into one vmware-bin file (as in append, like a .log
file does)?

I saw this post, but it doesn't answer any questions:
http://forums.mysql.com/read.php?28,74385,74385

Googling for 'mysql bin.01' seems to indicate these are related to
replication -- I'm not using replication.

ÐÆ5ÏÐ 

P.S. I found this link:
http://miniprep.caltech.edu/~remote/blog/?p=99
Which says to run "reset master;" -- which did get rid of them for now, but
my questions above are still valid.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: building mysql-5.0.22 from src

2006-08-03 Thread Chris

bruce wrote:

hi chris...

i tried that approach with MySQL-5.0.22

i did the rpmbuild -- ...

and got the rpms for mysql.

when i tried to install the mysql server rpm, it kicked out the dependency
error regading the libmysqlclient.so.14... other apps require this version
apparently.

i would have thought that building by source would have been ok...


.. so you'll have to install the -devel rpm with the new mysql headers 
(I think that's the one) and then compile the other apps, or use the 
.src.rpms for those apps and create your own versions.


It's pretty much an all-or-nothing situation, either you update mysql 
and all other apps (php etc) or you can't upgrade any of them. Not 
specifically a mysql issue, you'll get the same with any database or 
shared library.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: building mysql-5.0.22 from src

2006-08-03 Thread bruce
hi chris...

i tried that approach with MySQL-5.0.22

i did the rpmbuild -- ...

and got the rpms for mysql.

when i tried to install the mysql server rpm, it kicked out the dependency
error regading the libmysqlclient.so.14... other apps require this version
apparently.

i would have thought that building by source would have been ok...

-bruce


-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 03, 2006 5:38 PM
To: [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Subject: Re: building mysql-5.0.22 from src


bruce wrote:
> hi...
>
> i have FC3/4 systems. i'm going to need to have mysql-5.0.22, but there
> appears to be numerous dependencies that yum can't easily resolve from the
> RPM i've found.
>
> can i reasonably easily build mysql-5.0.22 from src for my FC3/4
systems...
> the systems are pretty much standard systems.

Sure but then you'd have to recompile php and any other dependencies
that rely on the mysql rpms being installed.

Grab one of the .src.rpms and rebuild that. It'll create new rpms based
on what you have installed on your system, and it also means you won't
have to touch your other packages either.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Multiple-Column Indexes Question

2006-08-03 Thread Chris

Arias Gonzalez, Javier wrote:

Assuming we have the following table:

 


CREATE TABLE test (

id INT NOT NULL,

last_name  CHAR(30) NOT NULL,

first_name CHAR(30) NOT NULL,

PRIMARY KEY (id),

);

 


With last_name having 1,000 different values and first_name having
1000,000 different values... What is better (if any) at the time of
querying the database:

 


A)  To define an index like: "INDEX name (last_name,first_name)" and
perform a query like: "select * from test where last_name='aaa' and
first_name='bbb'"

B)  To define an index like: "INDEX name (first_name,last_name)" and
perform a query like: "select * from test where first_name='bbb' and
last_name='aaa'"


I'd go for this one, so the first_name cuts down a lot of what you're 
searching for. Make sure your index matches (see next comment).



C)  It is irrelevant the order of the index definition.


The order of the indexed fields is extremely relevant.

Mysql (and other db's) will traverse things left to right. So in your 
example, if you create an index on:


first_name, last_name

but your queries are:

last_name='x', first_name='y'

mysql will not be able to use that index because it doesn't match up.

To take it further, if you have this:

create table a(
a int,
b int,
c int
);
create index blah on a(a,b,c);

and your query is:

select * from a where a='x' and b='y' and c='z';

Mysql will be able to use an index across all 3 columns.

If your query is:

select * from a where a='x' and c='z' and b='y';

then mysql will only be able to use the index to find the right 'a' 
values, and it will have to scan the results for the right b and c values.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: building mysql-5.0.22 from src

2006-08-03 Thread Chris

bruce wrote:

hi...

i have FC3/4 systems. i'm going to need to have mysql-5.0.22, but there
appears to be numerous dependencies that yum can't easily resolve from the
RPM i've found.

can i reasonably easily build mysql-5.0.22 from src for my FC3/4 systems...
the systems are pretty much standard systems.


Sure but then you'd have to recompile php and any other dependencies 
that rely on the mysql rpms being installed.


Grab one of the .src.rpms and rebuild that. It'll create new rpms based 
on what you have installed on your system, and it also means you won't 
have to touch your other packages either.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: version of mysql

2006-08-03 Thread Chris

Vittorio Zuccalà wrote:

Hello,
i'm installing an open source program based on mysql because i want to 
try it.

It controls mysql's version and it wants 4.1.16 but i've 4.1.11...

Is it possible telling to mysql server to give a different number of its 
version?


In other words: is there some configuration that let me to specify a 
different

version of mysql without install a newer version?


No.

Obviously the application wants some feature that's in 4.1.16 that isn't 
in an older version, otherwise they would reduce the requirements.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Running Totals?

2006-08-03 Thread Barry Newton

At 04:15 PM 8/3/2006, Brent Baisley wrote:
You might look into WITH ROLLUP. That could easily give you cumulative 
totals for the year, but off the top of my head I can't think of a way to 
get it for the months.


- Original Message - From: "Barry Newton" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, August 02, 2006 10:29 PM
Subject: Running Totals?



Back with another registration db question:

Have a convention database which tracks people as they register all year 
long; the actual convention is held in October.  I've got a fairly simple 
query which shows how many people registered in each calendar 
month--useful to compare to prior year to see if we're at least on track 
with our count.


It would make life easier if I could also show a column with the 
cumulative count for each month.  The existing output is:


That's what happens with ROLLUP.  I'm looking into a possible subquery 
approach just now.  If it works, it will be worth it's own post.



Barry



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Finding the closest value

2006-08-03 Thread Peter Brawley




Lee

>I think the formula is just right - very clever. But is it
possible to make 
>sure that col1, col2 and col3 are all from the same record?


Different question, different answer I ween 
:-) 

SET @n = ;
SELECT 
  id,
  MIN( LEAST( ABS(@n-col1), LEAST( ABS(@n-col2), ABS(@n-cl3) ))) AS min
FROM tbl
GROUP BY id;

PB

-

Lee Goddard wrote:
Peter
Brawley wrote:
  
  />Is there an efficient way to find the
closest numerical value, across

>three columns? I do not know if there is a way to find it across
one. /


Not sure about efficiency, but if the criterion number is @n, do you
mean ...


SELECT LEAST( ABS(MIN(@n-col1)),

  LEAST( ABS(MIN(@n-col2)),

 ABS(MIN(@n-col3))

   )

    )

FROM ...

  
I think the formula is just right - very clever. But is it possible to
make sure that col1, col2 and col3 are all from the same record?
  
  
Thanks in anticipation
  
Lee
  
  No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.5/406 - Release Date: 8/2/2006
  



No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.5/406 - Release Date: 8/2/2006


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Multiple-Column Indexes Question

2006-08-03 Thread Arias Gonzalez, Javier
Assuming we have the following table:

 

CREATE TABLE test (

id INT NOT NULL,

last_name  CHAR(30) NOT NULL,

first_name CHAR(30) NOT NULL,

PRIMARY KEY (id),

);

 

With last_name having 1,000 different values and first_name having
1000,000 different values... What is better (if any) at the time of
querying the database:

 

A)  To define an index like: "INDEX name (last_name,first_name)" and
perform a query like: "select * from test where last_name='aaa' and
first_name='bbb'"

B)  To define an index like: "INDEX name (first_name,last_name)" and
perform a query like: "select * from test where first_name='bbb' and
last_name='aaa'"

C)  It is irrelevant the order of the index definition.

 

 

Thanks in advanced

Javier

 

 



Re: Query problem

2006-08-03 Thread obed

On 8/3/06, André Hänsel <[EMAIL PROTECTED]> wrote:

Hi Dan, hi Obed,

of course I have no specific username, I want the last 5 downloads of each
distinct username in the table. :)



i was thinking a lot... and i can't find the solution but maybe yo
can do somthing like this

select user,download from table where user in (select distinct user
from tabla) order by time desc;

and in your front-end just display 5 for each user   xD

i you find the solution please let us know !

good luck


--

http://www.obed.org.mx ---> blog

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: AW: Query problem

2006-08-03 Thread John Meyer
André Hänsel wrote:
>> -Ursprüngliche Nachricht-
>> Von: Miles Thompson [mailto:[EMAIL PROTECTED] 
>> Gesendet: Donnerstag, 3. August 2006 21:56
>> An: mysql@lists.mysql.com
>> Betreff: Re: Query problem
>>
>> At 03:08 PM 8/3/2006, André Hänsel wrote:
>>
>>> I have a table logging downloads (time, username, download).
>>>
>>> Now I'd like to have the last 5 downloads per user.
>>>
>> That's almost like creating a view of users, then stepping 
>> through the 
>> view, selecting * limit 5 where username = view.username. See 
>> where that's 
>> headed? You may need a temporary table.
> 
> Assuming I have a (temporary) table of usernames, how can that be of any
> help?
> 
> 
all right, here's how this goes.

Create a stored procedure
WHERE YOU SELECT DISTINCT username.
Then for each user,
retrieve the five 5.
Put them in a union,
enjoy.

-- 
John Meyer
http://pueblonative.wordpress.com
http://pueblonative.110mb.com/board

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Running Totals?

2006-08-03 Thread Brent Baisley
You might look into WITH ROLLUP. That could easily give you cumulative totals for the year, but off the top of my head I can't think 
of a way to get it for the months.


- Original Message - 
From: "Barry Newton" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, August 02, 2006 10:29 PM
Subject: Running Totals?



Back with another registration db question:

Have a convention database which tracks people as they register all year long; the actual convention is held in October.  I've got 
a fairly simple query which shows how many people registered in each calendar month--useful to compare to prior year to see if 
we're at least on track with our count.


It would make life easier if I could also show a column with the cumulative 
count for each month.  The existing output is:

+---+--+---+--+
| Month | Year | Registrations | Monindex |
+---+--+---+--+
| October   | 2004 |23 |   200410 |
| December  | 2004 | 5 |   200412 |
| January   | 2005 | 9 |   200501 |
| February  | 2005 |11 |   200502 |
| April | 2005 | 2 |   200504 |
| May   | 2005 |48 |   200505 |
| June  | 2005 |45 |   200506 |
| July  | 2005 |10 |   200507 |
| August| 2005 |17 |   200508 |
| September | 2005 |58 |   200509 |
| October   | 2005 |97 |   200510 |
+---+--+---+--+

The cumulative column would ideally show 23,28,37, etc.

Also, if anyone has a better way to keep the different years apart than the 'monindex' column, or at least to suppress displaying 
it, I'll be really interested.


The existing query is:

Select Monthname(DatePaid) Month, Year(DatePaid) Year, count(*) as 
Registrations, Extract(Year_Month from DatePaid) Monindex
From capclave2005reg
Where year(DatePaid)=2004 and (amount > 0 or Dealer = 'Y')
Group by Monindex

Union

Select Monthname(DatePaid) Month, Year(DatePaid) Year, count(*) as 
Registrations,
Extract(Year_Month from DatePaid) Monindex
From capclave2005reg
where year(DatePaid)=2005 and (amount > 0 or Dealer = 'Y')
Group by Monindex;




Barry



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



AW: Query problem

2006-08-03 Thread André Hänsel
> -Ursprüngliche Nachricht-
> Von: Miles Thompson [mailto:[EMAIL PROTECTED] 
> Gesendet: Donnerstag, 3. August 2006 21:56
> An: mysql@lists.mysql.com
> Betreff: Re: Query problem
> 
> At 03:08 PM 8/3/2006, André Hänsel wrote:
> 
> >I have a table logging downloads (time, username, download).
> >
> >Now I'd like to have the last 5 downloads per user.
> >
> 
> That's almost like creating a view of users, then stepping 
> through the 
> view, selecting * limit 5 where username = view.username. See 
> where that's 
> headed? You may need a temporary table.

Assuming I have a (temporary) table of usernames, how can that be of any
help?


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Query problem

2006-08-03 Thread Miles Thompson

At 03:08 PM 8/3/2006, André Hänsel wrote:


Hi,

I have a table logging downloads (time, username, download).

Now I'd like to have the last 5 downloads per user.

Can someone tell me a solution (or what to search for)?

Regards,
André


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Correlated subquery, which can be the devil to debug, and don't run really 
quickly.

I have no idea if this will work:

SELECT t1.time, t1.username, t1.download FROM downloads AS t1
WHERE t1.username = ANY
(SELECT t2.username FROM downloads AS t2 WHERE t2.username = 
t1.username)

ORDER BY t1.time DESC
LIMIT 5

Hmmm, that's just going to return 5 records; you need 5 or fewer for each 
username.


That's almost like creating a view of users, then stepping through the 
view, selecting * limit 5 where username = view.username. See where that's 
headed? You may need a temporary table.


Sorry I've not been more help.

Regards - Miles Thompson


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.10.5/406 - Release Date: 8/2/2006



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Finding the closest value

2006-08-03 Thread Lee Goddard

Peter Brawley wrote:

/>Is there an efficient way to find the closest numerical value, across
>three columns? I do not know if there is a way to find it across one. /

Not sure about efficiency, but if the criterion number is @n, do you 
mean ...


SELECT LEAST( ABS(MIN(@n-col1)),
  LEAST( ABS(MIN(@n-col2)),
 ABS(MIN(@n-col3))
   )
)
FROM ...
I think the formula is just right - very clever. But is it possible to 
make sure that col1, col2 and col3 are all from the same record?


Thanks in anticipation
Lee


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: AW: Query problem

2006-08-03 Thread John Meyer
SELECT DISTINCT username, time, download
FROM table
 ORDER BY time DESC
GROUP BY username

André Hänsel wrote:
> Hi Dan, hi Obed,
> 
> of course I have no specific username, I want the last 5 downloads of each
> distinct username in the table. :)
> 
> Regards,
> André
> 
>> -Ursprüngliche Nachricht-
>> Von: Dan Buettner [mailto:[EMAIL PROTECTED] 
>> Gesendet: Donnerstag, 3. August 2006 20:15
>> An: André Hänsel
>> Cc: mysql@lists.mysql.com
>> Betreff: Re: Query problem
>>
>> For a specific username:
>>
>> SELECT username, time, download
>> FROM table
>> WHERE username = 'someusername'
>> ORDER BY time DESC
>> LIMIT 5
>>
>> Dan
>>
>> On 8/3/06, André Hänsel <[EMAIL PROTECTED]> wrote:
>>> Hi,
>>>
>>> I have a table logging downloads (time, username, download).
>>>
>>> Now I'd like to have the last 5 downloads per user.
>>>
>>> Can someone tell me a solution (or what to search for)?
>>>
>>> Regards,
>>> André
>>>
>>>
>>> --
>>> MySQL General Mailing List
>>> For list archives: http://lists.mysql.com/mysql
>>> To unsubscribe:
>> http://lists.mysql.com/[EMAIL PROTECTED]
>>>
>> -- 
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe:
>> http://lists.mysql.com/[EMAIL PROTECTED]
>>
> 
> 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



AW: Query problem

2006-08-03 Thread André Hänsel
Hi Dan, hi Obed,

of course I have no specific username, I want the last 5 downloads of each
distinct username in the table. :)

Regards,
André

> -Ursprüngliche Nachricht-
> Von: Dan Buettner [mailto:[EMAIL PROTECTED] 
> Gesendet: Donnerstag, 3. August 2006 20:15
> An: André Hänsel
> Cc: mysql@lists.mysql.com
> Betreff: Re: Query problem
> 
> For a specific username:
> 
> SELECT username, time, download
> FROM table
> WHERE username = 'someusername'
> ORDER BY time DESC
> LIMIT 5
> 
> Dan
> 
> On 8/3/06, André Hänsel <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I have a table logging downloads (time, username, download).
> >
> > Now I'd like to have the last 5 downloads per user.
> >
> > Can someone tell me a solution (or what to search for)?
> >
> > Regards,
> > André
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> >
> >
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Alter Problem

2006-08-03 Thread Nicholas Vettese

A quick question.  I do not have `userid` setup in my script to update my
table.  Right now it is setup like this: $query = "SELECT userid FROM
profile WHERE username = '$un'";

So when I go to change my usernamre, it creates a new row in the table with
all the info.  What would be the best way to use `userid`?

Thanks,
nick

- Original Message - 
From: "Miles Thompson" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, August 03, 2006 10:42 AM
Subject: Re: Alter Problem



At 11:12 AM 8/3/2006, Nicholas Vettese wrote:

I am working on a script that looks at the MySQL Table, checks to see if 
there are any matches, and if there are, alter the table to add the 
requested information.  Here is the code I am using:



$query = "ALTER profile (acct_type, username, firstname, lastname, email, addr1, city, state, zip, nude, artistic, model_look, about_you, why_model, genre) VALUES ('$at', '$un', '$fn', '$ln', '$e', '$ad1', '$c', '$st', '$zc', '$nd', '$art', '$ml', '$ay', '$wm', '$g')";


What am I doing wrong?  The error comes back saying that this is where the 
problem is, and I have changed it from UPDATE to ALTER because I was 
trying to get the information to be added to the table of an already 
registered user.


Nick


Nick,

Just to add to what Peter said, and so you do not inadvertently shoot 
yourself in the foot, have a look at some tutorials, like this one:

http://www.php-mysql-tutorial.com/
which appears to be divided into sections appropriate to operations on the 
database.


Then check the MySQL docs for specifics on SELECT, INSERT and UPDATE.

Fortunately your ALTER TABLE statement was incorrect, otherwise you would 
have destroyed the table and lost all of your data.


Regards - Miles Thompson

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.10.5/406 - Release Date: 8/2/2006



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Query problem

2006-08-03 Thread Dan Buettner

For a specific username:

SELECT username, time, download
FROM table
WHERE username = 'someusername'
ORDER BY time DESC
LIMIT 5

Dan

On 8/3/06, André Hänsel <[EMAIL PROTECTED]> wrote:

Hi,

I have a table logging downloads (time, username, download).

Now I'd like to have the last 5 downloads per user.

Can someone tell me a solution (or what to search for)?

Regards,
André


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Query problem

2006-08-03 Thread obed

On 8/3/06, André Hänsel <[EMAIL PROTECTED]> wrote:

Hi,

I have a table logging downloads (time, username, download).

Now I'd like to have the last 5 downloads per user.

Can someone tell me a solution (or what to search for)?




SELECT download FROM table WHERE username='user' ORDER BY time DESC LIMIT 5;

--

http://www.obed.org.mx ---> blog

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Query problem

2006-08-03 Thread André Hänsel
Hi,

I have a table logging downloads (time, username, download).

Now I'd like to have the last 5 downloads per user.

Can someone tell me a solution (or what to search for)?

Regards,
André


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Is this query possible?

2006-08-03 Thread Tanner Postert

the query works, but i need to get the total number of songs on that CD, as
well as the sum of the lengths of the songs on the CD... is that possible in
1 query?

On 8/2/06, Tanner Postert <[EMAIL PROTECTED]> wrote:


just to clarify to Brent, the songs lists the original artist and album.
the CD table is for the information for a NEW mix CD. that CD contains the
tracks listed in the tracks table, which point back to the individual songs.
the reason the tracks are not listed in the songs table, is because they can
be part of multiple CDs. one person could put that same song on tons of
different mix CDs as wells as other users using it too, anyways, thanks for
the help, i'll let you know how your suggestions faired.


On 8/2/06, John Meyer <[EMAIL PROTECTED]> wrote:
>
> I've dealt with this in terms of Books and Titles.  Those two are
> separate:
> one title can have many book editions published in it.  Also, you can
> have a
> book with multiple titles (anthology, for instance).
> I suppose it is possible for album not to be the same as cd title,
> particularly if you have old vinyl albums around that you want to sell.
>
> -Original Message-
> From: Brent Baisley [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 02, 2006 2:13 PM
> To: Tanner Postert; mysql@lists.mysql.com
> Subject: Re: Is this query possible?
>
> I'm not sure why you split out track, track is really kind of an
> attribute
> of a song. Especially since you have artist and album with the song.
> Wouldn't album be the same as cd title? I'm not quite getting the logic
> of
> your schema.
>
>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>
>



Re: upgrading mysql...

2006-08-03 Thread Daniel da Veiga

On 8/2/06, bruce <[EMAIL PROTECTED]> wrote:

hi..

i have FC3, with 4.1.13, i also have FC4 with 4.1.20. however, i can't seem
to find 5.0.x RPMs for FC3/4. do i have to go ahead and build this from
source for the FC3/4 boxes that i have...



Linux x86 generic RPM at:
http://dev.mysql.com/downloads/mysql/5.0.html

It wasnt that hard...

--
Daniel da Veiga
Computer Operator - RS - Brazil
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
--END GEEK CODE BLOCK--

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Check out this Free software I found to document your IT infrastruct

2006-08-03 Thread John Meyer

I think equating a tagline indicating something's been spam-checked
with a full out message for a web product is a little absurd.

On 8/3/06, Ian <[EMAIL PROTECTED]> wrote:


You say you hate spam then spam the list with an advert for McAfee!

Ian


--
"I'm American, fatboy.  What's your excuse?"

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Check out this Free software I found to document your IT infrastruct

2006-08-03 Thread Ian
On 3 Aug 2006 at 10:16, John Trammell wrote:



> If you hated spam as much as I did, you would have terminated this user,
> based on the egregious and well-documented abuse of this list.



> This message has been scanned for viruses by McAfee's Groupshield.

You say you hate spam then spam the list with an advert for McAfee!

Ian
-- 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Join with additional table, stumped

2006-08-03 Thread Dan Buettner

Scott, how about the use of a MERGE table?
create a merge table 'orders' with 'orders_npfd' and 'orders_npfs'
underneath it.

http://dev.mysql.com/doc/refman/5.0/en/merge-storage-engine.html

Dan


On 8/2/06, Scott Haneda <[EMAIL PROTECTED]> wrote:

Forgive the mess I present you, this is a strangely done site with a even
stranger structure and methodology that I am trying to work with.

The basic idea is one website has multiple websites in it.  So if you place
an order with website A, orders_A is where the data is stored, if you place
an order with website B, orders_B is where the data is stored.  The site
changes from A to B based on the url.  Anyway...

SELECT o.id, u.industry,
   u.email, u.b_first_name, u.b_last_name,
   t.created
FROM orders_npfd AS o
INNER JOIN users AS u
 ON (o.user_id = u.id)
INNER JOIN transactions as t
 ON (t.order_id = o.id)
WHERE t.type in ('first_charge', 'recurring')
ORDER BY t.created DESC;

This basically gives me a list of all orders that I want to see from the
orders_npfd table, works as I need it to.  Now, I need to add in a second
table, for the orders from the other table.  Table structure is more or less
the same, at least, the data I am selecting.  So the second table is
orders_npfs <- note the 's'

How can I add that in so I will get results out of that table as well?

Second problem, each order table of course gets an id, or orderId, in the
above example, it is o.id and linked to t.order_id.  The problem is, o.id is
autoinc PK and will/can overlap with the id's from the either of the orders
table.

However, users u.id will never overlap, nor share table data, so I think I
can use that in my condition to make sure there is no pollution of orders?

If I use a join in the above to get the second table data in there, I would
have to add in more x.foo items to my select, which really will not help me.

I am sure this is pretty confusing, if anyone has any suggestions, aside
from rethinking the design entirely, I would most appreciate it.

Maybe select the contents of both tables into a tmp table, and use that as
my join table above?
--
-
Scott HanedaTel: 415.898.2602
 Novato, CA U.S.A.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Database Return Errors

2006-08-03 Thread Asif Lodhi

Thanks for replying, John.

On 8/2/06, John Meyer <[EMAIL PROTECTED]> wrote:

Have you checked out MyConnector/NET and the MySqlException class?
From: Asif Lodhi [mailto:[EMAIL PROTECTED]
Subject: Database Return Errors
The question is:  Can I get the error-codes or error-names that MySQL
returns in VB6',s ADO.Erross collection?  Will I get one if MySQL throws an
error - such as when a duplicate constraint is violated?  ->  so that I can
display meaningful error messages to the user.


However, I am developing the app using VB6 and MS.NET driver, if I am
right, cannot help me in my scenario. And I cannot enjoy the benefit
of using MySQLException class either.  Do you know of any such class
for VB6?

--
Thanks

Asif

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Monitoring Slow Queries

2006-08-03 Thread Asif Lodhi

Thanks, Philip.
On 8/2/06, Philip Hallstrom <[EMAIL PROTECTED]> wrote:

..
http://hackmysql.com/mysqlsla
.

That's definitely of immense help.

--
Thanks a zillion,

Asif

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Check out this Free software I found to document your IT infrastruct

2006-08-03 Thread John Trammell
Will L. wrote: 
> Nabble hates spam as much as you do. We are currently monitoring this
> user and we will take necessary action just like a mailing list owner
> will do.

If you hated spam as much as I did, you would have terminated this user,
based on the egregious and well-documented abuse of this list.

Sayonara, spammy.
*plonk*


INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

This message has been scanned for viruses by McAfee's Groupshield.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



building mysql-5.0.22 from src

2006-08-03 Thread bruce
hi...

i have FC3/4 systems. i'm going to need to have mysql-5.0.22, but there
appears to be numerous dependencies that yum can't easily resolve from the
RPM i've found.

can i reasonably easily build mysql-5.0.22 from src for my FC3/4 systems...
the systems are pretty much standard systems.

thanks

-bruce


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Check out this Free software I found to document your IT infrastruct

2006-08-03 Thread Gerald L. Clark

Will L wrote:

Rob Munsch,

I am a member of the Nabble project. This is regarding a bad post by user
"itguy321". 


Just want to explain a few things. Nabble is a free mailing list
archive/gateway that works like Gmane.  Users can browse, search, and post
via Nabble's web interface and the post will be forwarded to the mailing
list as an email. A user will need to register with Nabble first, then he
will need to subscribe to the mailing list to become a subscriber, only then
can he post to that mailing list.

You seem to be holding Nabble responsible for this bad post. Is it fair? Is
it fair to blacklist Gmail just because a bad user sent a spam? A mailing
list usually has a moderation mechanism to deal with bad posts. If you are a
mailing list owner, you can simply ban that user.

Nabble hates spam as much as you do. We are currently monitoring this user
and we will take necessary action just like a mailing list owner will do.
Feel free to send me a private email if you have more concerns.

Regards,
Will L
Nabble.com




Well, he also spammed the Centos Forums.
--
Gerald L. Clark
Supplier Systems Corporation

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Alter Problem

2006-08-03 Thread Miles Thompson

At 11:12 AM 8/3/2006, Nicholas Vettese wrote:

I am working on a script that looks at the MySQL Table, checks to see if 
there are any matches, and if there are, alter the table to add the 
requested information.  Here is the code I am using:



$query = "ALTER profile (acct_type, username, firstname, lastname, email, addr1, city, state, zip, nude, artistic, model_look, about_you, why_model, genre) VALUES ('$at', '$un', '$fn', '$ln', '$e', '$ad1', '$c', '$st', '$zc', '$nd', '$art', '$ml', '$ay', '$wm', '$g')";


What am I doing wrong?  The error comes back saying that this is where the 
problem is, and I have changed it from UPDATE to ALTER because I was 
trying to get the information to be added to the table of an already 
registered user.


Nick


Nick,

Just to add to what Peter said, and so you do not inadvertently shoot 
yourself in the foot, have a look at some tutorials, like this one:

http://www.php-mysql-tutorial.com/
which appears to be divided into sections appropriate to operations on the 
database.


Then check the MySQL docs for specifics on SELECT, INSERT and UPDATE.

Fortunately your ALTER TABLE statement was incorrect, otherwise you would 
have destroyed the table and lost all of your data.


Regards - Miles Thompson 



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.10.5/406 - Release Date: 8/2/2006



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Alter Problem

2006-08-03 Thread Peter Lauri
Comment: ALTER is used to change the structure of an table, for example add
an extra column or change the default values etc. Or to add an index or
similar.

-Original Message-
From: Nicholas Vettese [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 03, 2006 9:12 PM
To: mysql@lists.mysql.com
Subject: Alter Problem

I am working on a script that looks at the MySQL Table, checks to see if
there are any matches, and if there are, alter the table to add the
requested information.  Here is the code I am using:


$query = "ALTER profile (acct_type, username, firstname, lastname, email,
addr1, city, state, zip, nude, artistic, model_look, about_you, why_model,
genre) VALUES ('$at', '$un', '$fn', '$ln', '$e', '$ad1', '$c', '$st', '$zc',
'$nd', '$art', '$ml', '$ay', '$wm', '$g')";


What am I doing wrong?  The error comes back saying that this is where the
problem is, and I have changed it from UPDATE to ALTER because I was trying
to get the information to be added to the table of an already registered
user.

Nick


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Alter Problem

2006-08-03 Thread Peter Lauri
Maybe:

$query = "UPDATE profile SET acct_type='%at', ., genre='$g' WHERE
id=$userid"

/Peter

-Original Message-
From: Nicholas Vettese [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 03, 2006 9:12 PM
To: mysql@lists.mysql.com
Subject: Alter Problem

I am working on a script that looks at the MySQL Table, checks to see if
there are any matches, and if there are, alter the table to add the
requested information.  Here is the code I am using:


$query = "ALTER profile (acct_type, username, firstname, lastname, email,
addr1, city, state, zip, nude, artistic, model_look, about_you, why_model,
genre) VALUES ('$at', '$un', '$fn', '$ln', '$e', '$ad1', '$c', '$st', '$zc',
'$nd', '$art', '$ml', '$ay', '$wm', '$g')";


What am I doing wrong?  The error comes back saying that this is where the
problem is, and I have changed it from UPDATE to ALTER because I was trying
to get the information to be added to the table of an already registered
user.

Nick


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Alter Problem

2006-08-03 Thread Nicholas Vettese
I am working on a script that looks at the MySQL Table, checks to see if there 
are any matches, and if there are, alter the table to add the requested 
information.  Here is the code I am using:


$query = "ALTER profile (acct_type, username, firstname, lastname, email, 
addr1, city, state, zip, nude, artistic, model_look, about_you, why_model, 
genre) VALUES ('$at', '$un', '$fn', '$ln', '$e', '$ad1', '$c', '$st', '$zc', 
'$nd', '$art', '$ml', '$ay', '$wm', '$g')";


What am I doing wrong?  The error comes back saying that this is where the 
problem is, and I have changed it from UPDATE to ALTER because I was trying to 
get the information to be added to the table of an already registered user.

Nick

Re: Table analysis - Help required urgently

2006-08-03 Thread Brent Baisley
You should look at what MySQL is doing, start by looking at SHOW STATUS and SHOW VARIABLES. The SHOW STATUS will give you an idea 
how your indexes are performing, thread management, open file management, etc. You can file a lot of info in there and some 
variables you can adjust on the fly. There is a bunch of stuff on the internet on how to "read" the status values and determine 
ratios. Also, High Performance MySQL I think is an excellent book that cover a lot of bases.


Based on google results, 50 lakhs is about 5,000,000 (5 million) rows. Depending on setup, it may be a lot. I've got "tables" with 
over 250 laks without performance issues. I must clarify that the 250 million row "table" is actually a MERGE table with the 
underlying tables each holding abuout 20-30 millions rows. We did start having performance slow down before switching to the merge 
format. Now once a month a script runs that creates a new empty table and alters the merge table to include the new empty table 
where all new records are entered.
You may or may not be able to use MERGE tables in your case. Records are not deleted from our tables, we just drop the oldest table 
after a certain length of time (i.e. 6 months).


So how large can a table be? As large as you want.

- Original Message - 
From: "Ratheesh K J" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, August 03, 2006 2:42 AM
Subject: Table analysis - Help required urgently


Hello all,

I am required to analyze all the tables of our system. I need to know the key parameters that should be taken into consideration for 
analysis. I am not speaking about ANALYZE TABLE . I am required to manually look into all table structures and pin point 
problems ( if any ).


So it would be helpful if i could know about

1) what exactly I have to look for in the tables.

2) Index management. Which fields are to be indexed and which not

3) How big can a table be? We have tables which have more than 50 lakhs of rows. Any select queries, insert queries or update 
queries are taking more time to execute. So what is a preferable table size.


4) Any other suggestions

Thanks,

Ratheesh Bhat K J


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: How many columns??

2006-08-03 Thread Miles Thompson

At 06:32 AM 8/3/2006, Ratheesh K J wrote:


Hello all,

Just wanted to know how many columns are preferable in table. At present 
we are having nearly 50 - 60 columns in some of the tables. Is this ok or 
should we be splitting the tables for normalization.


If we really need to split then how better would it be in terms of 
performance.?


1) Splitting into related tables would then require Joins for data retrieval
2) Inserts/ updates will have to be done on more than one table now

It would be great to also know the best practices on number of rows that a 
table must hold.



Ratheesh Bhat K J



Read up on database normalization - there are benefits other than speed.

Retrieval is very fast when tables are appropriately indexed, so that's a 
non-issue. Similarly once a query is defined it's usually the conditions in 
the WHERE clause that change, so that is a non-issue as well.


With data normalized to third normal form, is you have to revise your 
structure or change the data you are storing, you will not break your 
application or your existing queries.


You may find, after normalizing your data, that you want to de-normalize 
part of it, at least you are doing so with full awareness of what it looks 
like in normal form.


As for number of rows - check the archives. There are tables with millions 
of rows, their number is generally not an issue. Remember that if a 
database grows and grows and grows, then suddenly performance hits the 
wall, you've likely reached the limits of the hardware it's running on, not 
the database.


Cheers - Miles


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.10.5/406 - Release Date: 8/2/2006



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



version of mysql

2006-08-03 Thread Vittorio Zuccalà

Hello,
i'm installing an open source program based on mysql because i want to 
try it.

It controls mysql's version and it wants 4.1.16 but i've 4.1.11...

Is it possible telling to mysql server to give a different number of its 
version?


In other words: is there some configuration that let me to specify a 
different

version of mysql without install a newer version?

I hope i was clear...

Thanks in advance for your answers

--
vittorio zuccalà
Finconsumo Banca SPA
[EMAIL PROTECTED]
Tel: 011-6319464



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Questions on PRIMARY KEY

2006-08-03 Thread Aleksandar Bradaric
Hi,

> WHERE
> col1 >  AND col2 >  etc...
> AND PRIMARYKEY > 0;
[...skip...]
> I need an explanation of whether what I did is an
> optimization or not? Or should i be looking into something
> else to actually optimize the query.

The  best way to optimize it is would be to add an index for
some  or  all the columns from the WHERE clause. Once you do
that you will not need the `AND PRIMARYKEY > 0` part and the
query   will  truly  be  using  the  index  to  improve  the
performance.


Best regards,
Aleksandar


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Questions on PRIMARY KEY

2006-08-03 Thread Ratheesh K J
Hello all,

Need an explanation on this:

SELECT col1, col2, ...
FROM tbl1 JOIN tbl2 ON (some cond)
 JOIN tbl3 ON (some cond)
.
.
.
WHERE
col1 >  AND col2 >  etc...


Running an EXPLAIN on the above shows that the join type is ALL. I came to know 
that MySQL is not able to use any INDEX for the above query. The query is such 
that it does not require any search on PRIMARY KEY and that is why it is not 
used in the WHERE clause.


To optimize this query I did the following:
SELECT col1, col2, ...
FROM tbl1 JOIN tbl2 ON (some cond)
 JOIN tbl3 ON (some cond)
.
.
.
WHERE
col1 >  AND col2 >  etc...
AND PRIMARYKEY > 0;

Now running an EXPLAIN showed join type as range and showed that it had to scan 
half the number of rows less than the previous time. It Was using PRIMARYKEY 
column as the INDEX this time.

I need an explanation of whether what I did is an optimization or not? Or 
should i be looking into something else to actually optimize the query.

Thanks

Ratheesh Bhat K J


How many columns??

2006-08-03 Thread Ratheesh K J
Hello all,

Just wanted to know how many columns are preferable in table. At present we are 
having nearly 50 - 60 columns in some of the tables. Is this ok or should we be 
splitting the tables for normalization. 

If we really need to split then how better would it be in terms of performance.?

1) Splitting into related tables would then require Joins for data retrieval
2) Inserts/ updates will have to be done on more than one table now

It would be great to also know the best practices on number of rows that a 
table must hold.


Ratheesh Bhat K J


Re: Fatal error

2006-08-03 Thread Martin Jespersen

1) Throw away the backup.sql as it is useless
2) Talk to the guys who made drupal and make them aware of the flaw in 
their software

3) Change the php.ini settings for maximum execution time

next time try to place non-mysql related questions elsewhere ;)

Kaushal Shriyan wrote:

On 8/3/06, Martin Jespersen <[EMAIL PROTECTED]> wrote:

Looks like drupal had an error when doing the backup - mysql is
complaining over the fact that your backup.sql file contains a html
formated fatal error message.

Kaushal Shriyan wrote:
> Hi ALL
>
> I have taken backup of http://mydomain.com/?q=admin/database through
> drupal 4.6.3  by selecting all tables and it asked me to save as
> backup.sql.
>
> Now when i run
>
> [EMAIL PROTECTED] root]# mysql -u kaushal -h bdc31096e.in.office.aol.com -p
> drupal < /home/kaushal/drupal/backup.sql
> Enter password:
> ERROR 1064 at line 55817: You have an error in your SQL syntax near 
'

> Fatal error:  Maximum execution time of 30 seconds exceeded in
> ' at line 1
> [EMAIL PROTECTED] root]#
>
> I get the above error
>
> Any clue
>
> Please let me know if you need more info on this issue
>
> Thanks and Regards
>
> Kaushal
>



Hi Martin

How do i fix this issue

Thanks

Kaushal



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Fatal error

2006-08-03 Thread Kaushal Shriyan

On 8/3/06, Martin Jespersen <[EMAIL PROTECTED]> wrote:

Looks like drupal had an error when doing the backup - mysql is
complaining over the fact that your backup.sql file contains a html
formated fatal error message.

Kaushal Shriyan wrote:
> Hi ALL
>
> I have taken backup of http://mydomain.com/?q=admin/database through
> drupal 4.6.3  by selecting all tables and it asked me to save as
> backup.sql.
>
> Now when i run
>
> [EMAIL PROTECTED] root]# mysql -u kaushal -h bdc31096e.in.office.aol.com -p
> drupal < /home/kaushal/drupal/backup.sql
> Enter password:
> ERROR 1064 at line 55817: You have an error in your SQL syntax near '
> Fatal error:  Maximum execution time of 30 seconds exceeded in
> ' at line 1
> [EMAIL PROTECTED] root]#
>
> I get the above error
>
> Any clue
>
> Please let me know if you need more info on this issue
>
> Thanks and Regards
>
> Kaushal
>



Hi Martin

How do i fix this issue

Thanks

Kaushal

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: select between date

2006-08-03 Thread Penduga Arus

On 8/1/06, Chris <[EMAIL PROTECTED]> wrote:

Did you look at the link David sent you?

http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html


thanks.. I manage to do that.. below is my solution. please advice if
there is any better solution

SELECT a017namaper, DATE_FORMAT(a017tkhlahir, '%e/%c/%Y') as a017tkhlahir,
MONTH(a017tkhlahir) as bulan, DAY(a017tkhlahir) as tarikh
FROM a017
MONTH(a017tkhlahir) BETWEEN MONTH(CURDATE())  and
MONTH(ADDDATE(CURDATE(), INTERVAL 7 DAY))
AND DAY(a017tkhlahir) BETWEEN DAY(CURDATE()) and
DAY(ADDDATE(CURDATE(),INTERVAL 7 DAY))
ORDER BY bulan, tarikh

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]