Re: Append one table to another?

2005-10-11 Thread Jose Miguel Pérez
Hi Brian! > How do I append one table's contents to another? Both have identical > structure. Problem is I don't have shell access, only phpAdmin or a > PHP file I write & upload myself. You can do it this way: INSERT INTO table1 SELECT * FROM table2; If you need to have more co

Re: MySQL Subquery bug or am I doing something wrong?

2005-09-01 Thread Jose Miguel Pérez
Hi Pooly! >> mysql> SELECT criterio, idSite >> -> FROM dominios_propios_completos >> -> WHERE criterio NOT IN ( >> -> SELECT criterio_pub >> -> FROM sites_criterios >> -> ); >> Empty set (0.05 sec) > > Do you have NULL values in sites_criterios.criterio_pub ? Yes P

MySQL Subquery bug or am I doing something wrong?

2005-09-01 Thread Jose Miguel Pérez
Hi Folks! I have a problem with a subquery using MySQL 4.1.12 (Fedora Core 4). I will include the SHOW CREATE TABLE for the two tables involved. Please, forgive me if I include this information in my original language (Spanish) but I wish to keep the field names as is to avoid any mistake.

Re: SELECT on string field

2005-02-01 Thread Jose Miguel Pérez
Hi Arcangelo! Try this: SELECT COUNT(*), url, SUBSTRING_INDEX(url, "?", 1) AS page_name FROM sites GROUP BY page_name SUBSTRING_INDEX will return the leftmost (or rightmost) part of a string before the ocurrence of a delimiter ("?" in this case. See Documentation:

Re: c program Bus Error (core dumped)

2005-01-11 Thread Jose Miguel Pérez
Hi Andy! > After compiling with the options (as suggested by Jose Miguel Pérez) [...] > I now get ... > Everything Cool with the connection > Bus Error (core dumped) > > Sound familiar!! Sorry Andy but I couldn't help any more. I am not familiar with Solari

Re: c program Bus Error (core dumped)

2005-01-11 Thread Jose Miguel Pérez
Hi Andy! > but I still get the Bus Error message with the following code... > int main(char **args) { > MYSQL_RES *result; > MYSQL_ROW row; > MYSQL *connection, mysql; > int state; > int PORTNUM = 3306; [...] Andy, I have copied and pasted your code into a fresh new check.

Re: c program Bus Error (core dumped)

2005-01-11 Thread Jose Miguel Pérez
Hi Andy, > state = mysql_query(connection, "SELECT * from mytable"); *** ^^ > if( state ) { > printf(mysql_error(connection)); > return 1; > } else { > printf("Everything Cool with the query\n"); > } // New code,

Compiling 4.0.22 source including some 4.1.x functions

2004-11-30 Thread Jose Miguel Pérez
Hi all! I would like to know if it's possible to compile a custom 4.0.22 server including some functionality from 4.1.x source tree. The functionality I would like to include it's neither critical nor substantial. Basically, what I would like to include is the COMPRESS / UNCOMPRESS functions (

RE: COUNT Problem

2004-10-17 Thread Jose Miguel Pérez
Hi Shaun! I beg you pardon, my last message was incomplete! I will quote the last lines from my previous post: ---8<- Cut here ---8<--- > > - Thanks to the LIMIT clause, we get only the first result, which by > the way is one of the projects with the most assigned tasks.

RE: COUNT Problem

2004-10-17 Thread Jose Miguel Pérez
Hi Shaun! > A Project will have 1 or more tasks assigned to it. Using the > following > query, how can I modify it so that I can find out the largest > number of > tasks assigned to a group of projects. > > SELECT P.*, T.* > FROM Projects P, Tasks T > WHERE P.Project_ID = T.Project_ID > AND P

RE: Query with group by

2004-09-21 Thread Jose Miguel Pérez
Hi Michael! Talking about the "query with group by issue"... > I'll explain my reasoning below. [...] > From the manual, section "7.2.8 How MySQL Optimizes LEFT > JOIN and RIGHT > JOIN" : > >A LEFT JOIN B join_conditi

Re: Query with group by

2004-09-16 Thread Jose Miguel Pérez
Hi Michael! Yes, you're right, thanks for extending and clarifying my message. However, I'm not confident about your comments on the inefficiency for the following query: > > SELECT c1.date, c1.location, c1.version > > FROM cities c1 > > LEFT JOIN cities c2 > >

Re: Query with group by

2004-09-16 Thread Jose Miguel Pérez
Hi Vincent! > i'm trying to built a query that report me the latest tuple for a given > field. > I explain myself a bit. Let's say i have a table such this : There is no simple solution to your problem. Strictly speaking, it's forbidden to name a column in the SELECT clause which is NOT on th

Re: In search of a good MySQL GUI client

2004-09-09 Thread Jose Miguel Pérez
On Thursday, September 09, 2004 - Karam Chand said: > Probably you should put it as a bug in SQLyogs forums. I have put a bug request into the MySQL Query Browser bug track instead. I like this tool very much, it has some very nice features like the multithreaded results fetching. Cheers

Re: In search of a good MySQL GUI client

2004-09-09 Thread Jose Miguel Pérez
Karam Chand said: > I use SQLyog. It does allow you to create/delete FKs > with "ON UPDATE" criterias. > > Yeah, it does not allow you to create Fks in graphical > manner like MS SQL Server but does my purpose. One > feature I really miss is Editing of FKs. Yeah, I also tried SQLyog. It's a v

In search of a good MySQL GUI client

2004-09-08 Thread Jose Miguel Pérez
Hi All! Why are all MySQL GUI clients so bad with foreign keys? Sorry to seem annoyed, but I have used for quite some time a few GUI clients, notably MySQL-Front, which I were relatively confortable with. Anyway, all GUI clients I used (SQLyog, MySql-Front, MySQL-CC, you name it) seemed to be

Deleting using a table as reference.

2003-12-04 Thread Jose Miguel Pérez
Hi All! I have a problem deleting from a table and using another as reference. I use a query like: DELETE tableA FROM tableB WHERE tableA.idB = tableB.id AND tableA.data1= AND tableB.data2= (I'm using MySQL 4.0.12 on Red Hat 8

Re: How many records can a single MySql Table Hold.

2003-08-22 Thread Jose Miguel Pérez
Hi Rupak! > We are using MySql version 3.27.53 on a Red Hat Linux platform version > 7.2. For the past couple of months we are noticing that the performance > of the server has gone down very badly. Every, single insertion is > taking a hell lot of time.The particular table has only 150,000 reco

Re: Specifics on using join & multiple tables

2003-06-05 Thread Jose Miguel Pérez
Hi Patrick! > I need: > > acc.name, acc.phone, acc.acctno, sales1.amt as mo1sales, sales2.amt as > mo2sales, (sales1.amt - sales2.amt) as diff SORT by diff > > I need all data in sales1 and sales2, but only for records from > acc that are in either/both sales1, sales2. > > I tried: > select f

Re: nested ORDER BY statements

2003-06-05 Thread Jose Miguel Pérez
Hi David, > Hello - I'm a relative newcomer to development with MySQL and am having a > problem with ordering my query results... This is a general SQL question. Try this: ... ORDER BY time_created DESC, name LIMIT ... In general, you can't declare a clause twice, except for the

Re: Problem connecting with sockets to MySQL

2003-05-29 Thread Jose Miguel Pérez
Hi Nils! First of all, thanks for your reply. > I believe you miss an important point. Error 1130 means that the host (ip > address) is not allowed to connect, it doesnt mean that its not physically > possible. You have to check the privileges you gave the user or host that > doesnt work.

Problem connecting with sockets to MySQL

2003-05-29 Thread Jose Miguel Pérez
Hi all! I have asked this before, but no replys. I'll rewrite the question because I don't know if I got understood. ;-) Anyway, I have not found a MySQL list best suited for this question, so here I go... ¿Anyone knows why the server (mysqld) behaves differently to clients connecting fro