DECODE, not to decrypt but as trigger

2004-02-26 Thread Mahefa Randimbisoa\\DS-ETU
Hi! You should know the meaning of next SQL statements : SELECT DECODE(field_name, '0', 'Sunday', '1', 'Monday', '2', 'Tuesday') FROM table_name (This should mean : if field_name = '0', return 'Sunday', if field_name = '1', returns 'Monday', ...) I try to use this with mysql (in EasyPHP: Apache

Re: SQL join help

2002-05-20 Thread ds
On Mon, 2002-05-20 at 13:34, Ray Zimmerman wrote: ... > For example, given the following data ... > >CREATE TABLE Object ( > id int(11) NOT NULL auto_increment, > PRIMARY KEY (id) >); > >INSERT INTO Object (id) VALUES (1); >INSERT INTO Object (id) VALUES (2); >INSE

Re: SELECT/JOIN problems

2002-04-29 Thread ds
Hi, you need a LEFT JOIN on your query. See http://mysql.com/doc/J/O/JOIN.html Try somthing like: SELECT m.firstname, m.lastname FROM tbl_membernames as m LEFT JOIN tbl_paid as p ON (m.name_id=p.name_id and p.year=2000) WHERE p.name_id IS NULL On Mon, 2002-04-29 at 09:37, Markus Lervik wrot

Re: delta between rows?

2002-04-24 Thread ds
Hi, > how can I generate a list of deltas between columns in different rows for > the entire table? > what I need is an sql command that does something like this: > for N =0 to i do : select "colA of current rowN" - "colA of pervious > row(N-1)" from tab1; > > ColA = floating point number. Yo

Strange behaviour with SQL vars and order by

2002-04-22 Thread ds
Hi, I'm having a strange problem using SQL vars (@variable) and an order by expression. I have a query that returns a record for each day. Each record has a date (data), a column with the daily total value (uv_views) and other with the accumulated value until the current day (acc_views). The ot

Re: error : Fatal error: Call to a member function on a non-object

2002-04-16 Thread ds
Hi, That's not a Mysql error, it's an error from the language you are using (i suppose it's PHP). You did not define $dbconn. You're mixing functional programming with object oriented programming (i think). Instead of > $result=$dbconn->Execute("update info set . Try $result=mysql_

Re: BUG using left join.

2002-04-15 Thread ds
Hi, Note that if you are using a condition on a t_boxdaily field in the where clause, i think that your "left join" will not take the desired effect. If there is a record in table t_fund that it's not in t_boxdaily then the t_boxdaily fields would appear in the result with NULL values (because

Re: mysqldump

2002-04-12 Thread ds
On Fri, 2002-04-12 at 16:39, Steve Buehler wrote: > Not a bad Idea. I guess I will have to hit the php mailing list to find > out about this because I tried the following in PHP and it still did the > same thing. > require("../globals.inc"); > $test=passthru("mysqldump -q -u$userName -p$passwo

Re: outer joins

2002-03-22 Thread ds
Hi, did you get any answer ? I'm having the same problem. If i wanted all results from table1, even if they don't appear in table2 i would do like: SELECT . FROM table1 LEFT JOIN table2 ON (table1.id=table2.id) ... But how to join SELECT . FROM table1 LEFT JOIN table2 ON (table1.id=t

Re: mysqlhotcopy: doesn't copy tables ??

2002-03-20 Thread ds
Check ownership and permissions of MyDatabase_copy directory (and maybe the files). On Wed, 2002-03-20 at 02:01, Ashwin Kotian wrote: > I'm using the following syntax to backup one of my Mysql databses using > mysqlhotcopy: > > #/usr/bin/mysqlhotcopy --allowold MyDatabase MyDatabase_copy > > T

Re: where are my.cnf anf mysql log file.

2002-03-14 Thread ds
I don't know if this will help you but try this: # mysqld --help | grep "dir:" basedir: / datadir: /var/lib/mysql/ tmpdir: /tmp/ So, you'll find mysql log files in your datadir (is this case, /var/lib/mysql/). my.cnf is usually at /etc/my.cnf If you don't have it, find a configura

Re: mysqlbug

2002-03-14 Thread ds
On Thu, 2002-03-14 at 00:04, [EMAIL PROTECTED] wrote: > Please, i'll need some help. > I've installed mysql-3.22.32 in my machine, and when i run (from > /usr/local/mysql) > ./bin/safe_mysqld & > this is the bug that present (from my *.err file) > /*

Re: 3rd time and last

2002-03-14 Thread ds
This has nothing to do with this list... It's just that i'm sorry for the message i sent today, i agree with ppl who answered me and realised i was being..well...you know what. Once again, sorry, i won't do it again and thank you for the answers. -- dsoares (sql) --

3rd time and last

2002-03-14 Thread ds
This is my last mail trying to get an answer from you to those 2 questions. You could at least say: go to the manual or "don't know" or "don't ask it again" or something Is the subject boring ?!?!?! _ Subject: Default RPMs and RAID support I want to

An opinion about indexes

2002-03-13 Thread ds
Hi, I need your opinion about optimizing this query... I would really appreciate your help on this: The following table saves data about views to certain object identified by (cod-campanha,cod_tema,cod_canal,tipocanal,localizacao,seccao) from users. Each tuple (cod-campanha,cod_tema,cod_canal,

Re: mySQL connection problem

2002-03-13 Thread ds
On Wed, 2002-03-13 at 08:08, b g wrote: > when I m in root or mysql USER login.. then I can > login to mySQL server.. its fine.. > but other than 'root' and 'mysql', i can not connect > to the database server.. With which user are you trying to connect ? Did you grant permissions to that user ? B

Re: can not backup table

2002-03-13 Thread ds
On Wed, 2002-03-13 at 01:48, Abi wrote: > Hi, > I have this following error when back up table : > > mysql> lock tables mytable read; > Query OK, 0 rows affected (0.02 sec) > > mysql> select * into outfile > '/home/myhome/dump/mytable.txt' from mytable; > > ERROR 1: Can't create/write to file >

Default RPMs and RAID support

2002-03-13 Thread ds
I want to use the MySQL default binaries (i used to build them in my own machine, but i have followed this list and you're always saying to use the default ones). My question is: is there a way of using the default binaries and have Table type=RAID support ? Thanks in advance. -- dsoares (sq

Default RPMs and RAID support

2002-03-12 Thread ds
I want to use your binaries (i used to build them in my own machine, but i have followed this list and you're always saying to use yours). Just a question: is there a way of using your binaries and have Table type=RAID support ? -- dsoares (sql)

Re: installation problem

2002-03-12 Thread ds
You have a strange problem so i've searched the MySQL manual: http://www.mysql.com/doc/S/t/Starting_server.html - If you get the following error, it means that some other program (or another mysqld server) is already using the TCP/IP port or socket mysqld is tryi

Re: installation problem

2002-03-12 Thread ds
> [root@coolnis-ar mysql]# more my.err > 020312 15:56:40 mysqld started > 020312 15:56:40 Can't start server : Bind on unix socket: Permission denied > 020312 15:56:40 Do you already have another mysqld server running on > socket: /var/lib/mysql/mysql.sock ? > 020312 15:56:40 Aborting > > 02

Re: installation problem

2002-03-12 Thread ds
Check /var/lib/mysql/.err and permissions in that directory. Does the mysql user have the permission to write on that directory ? You you don't have the log error (it's very strange if you don't...), i think safe_mysqld has the option --err-log= (but, by default, it should be there). I'm not shur

Re: LEFT/RIGHT Join?

2002-03-12 Thread ds
Try: select t1.player,t1.game,t1.points,t1.ppg,t2.team as team_name from sc_scoreleaders as t1 left join sc_seasonstanding as t2 ON t1.team=t2.id You don't need to join sc_scoreleaders 2 times... Better: select t1.player,t1.game,t1.points,t1.ppg, ifnull(t2.team,"No Team") as team_name

An opinion about indexes

2002-03-12 Thread ds
Hi, I need your opinion about optimizing this query... I would really appreciate your help on this: The following table saves data about views to certain object identified by (cod-campanha,cod_tema,cod_canal,tipocanal,localizacao,seccao) from users. Each tuple (cod-campanha,cod_tema,cod_canal,

Re: Request-URI Too Large

2002-03-11 Thread ds
If all the data is in your database, why are you passing it in your query-string ?!?!?!!? Why don't you simply pass the idx like: Hi, > > To give you all an idea, i have a script named editform01.php that first > displays the data in a table. ThenI have this link called "Edit" in which it > goe

Re: Mysql installation. Help!

2002-03-11 Thread ds
> > I don't understand the code. I copy it from a book. I am trying to print out > the records returned from a query. I have a table named client in database > andy. The table has 2 records. When I run the above code, I have 2 blank > lines return. Could any one tell me what the problem is?

Re: HEAP Tables Inherit Index?

2002-03-07 Thread ds
Hi, On Wed, 2002-03-06 at 15:50, Scalper wrote: > If I create a temporary heap table from a select statement, does the new > table also inherit the indexes (indices?) from the original table. Or will I think that every CREATE [...] TABLE [...] SELECT does not inherit any indexes (doesn't mat

RE: MySQL Database Replication

2002-03-07 Thread ds
On Wed, 2002-03-06 at 14:26, Thi Cao wrote: > When I grant privileges as follows, the slave gets updated: > > GRANT FILE ON *.* to repl@'%' identified by 'some_password'; > > Could someone please tell me why I must grant the FILE privilege on all > databases for the repl (slave) to be able to up

Problem with LEFT JOIN

2002-03-04 Thread ds
> Hi, please help me with this problem... > > Suppose i have a table whith ids and two more tables with logs like > this: > > table0: id1,id2 > table1: id1,id2,date,ip > table2: id1,id2,date,ip > > Table0 is where i have all existent pairs (id1,id2). > Table1 logs all events of type 1. > table2

table0 LEFT JOIN table1,table2 ?

2002-03-04 Thread ds
Hi, Suppose i have a table whith ids and two more tables with logs like this: table0: id1,id2 table1: id1,id2,date,ip table2: id1,id2,date,ip Table0 is where i have all existent pairs (id1,id2). Table1 logs all events of type 1. table2 logs all events of type 2. My problem is that i need to l

"Got an error reading communication packets"

2001-08-07 Thread DS
Anyone seen this in your log file before? It's perlscripts on the same host, so before the DBI routine all the data needed for an insert is on the machine, not like it's loggin in from another machine. Could this be a problem with the loop back device? Any other ideas as to what causes mysql to

Re: Hanging on Inserts

2001-07-30 Thread DS
$100 :) I can't find anything anywhere in the books that explain why an insert would hang. Best David --- DS <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a problem that came out of nowhere and seems > only to affect inserts and only on 2 tables. > > The mach

Hanging on Inserts

2001-07-30 Thread DS
Hi All, I have a problem that came out of nowhere and seems only to affect inserts and only on 2 tables. The machine is a linux box w/ 2gig of memory and 2 pentium gig procs.. Mysql 3.23 One script that locks the tables, does an insert in one query to a table that is 120,000 record and another