Count even when empty

2004-08-14 Thread John Berman
Further to my earlier query Im using this SELECT dbo.members_.List_, COUNT(dbo.members_.EmailAddr_) AS nojgid FROM dbo.members_ INNER JOIN dbo.lists_ ON dbo.members_.List_ = dbo.lists_.Name_ INNER JOIN dbo.topics_ ON dbo.lists_.T

Count of two fields

2004-08-14 Thread John Berman
Wonder if you can help I have a table with a number of fields but the List Name Member Info Ever member in the table has a list and some members have something in the info field, Im after a count by list name So for instance the result im after would be something like L

Re: Language Searching

2004-08-14 Thread Ìèõàèë Ìîíàø¸â
KT> The database has "Niño" in it. I want it to be returned if the user KT> searched by using "nino" or "niño". Normalize words before using mysql. Use regexp to convert 'n' -> 'ñ'. 1.Create columns with normalized data. 2.Fill it. 3.Use columns with normalized data for search and use normalizing

RE: Cannot be null problem

2004-08-14 Thread Schalk Neethling
When sending form data via a form I get the following SQL error ERROR:-- SQLException - Message: The url cannot be null SQLState: 08001 ErrorCode :0 What does this mean? The row url, is not set to be not null. -- Kind Regards Schalk Neethling Web Developer.Designer.Programmer.President Volu

Language Searching

2004-08-14 Thread Karl Timmermann
Hi, Does anyone how I could accomplish this: Basically, I have a MySQL database of names - some names have Spanish accents in them. I want to build a web interface in PHP to search this database. However, I want the names with Spanish accents to be shown in the search results, regardless if the sea

Control Counters

2004-08-14 Thread Demetrios Stavrinos
The requirement is for a numeric counter which starts from a value, gets incremented by one to a max value and then resets to the start value. Currently, I keep these on a table of counters and do the lock, read, update, unlock. Is there a "better way" to implement this using mysql for keeping tr

Kernel panic when mysql stop command issued

2004-08-14 Thread Demetrios Stavrinos
Kernel panic: Fatal exception in interrupt...In Interrupt handler - not syncing message appears when the mysql-max stop is issued. Other than that everything works. I changed hardware (everything new) and re-installed Linux and MySQL and upgraded to latest 2.6.3 from mdk (It was happening with the

RE: GROUP BY optimization headscratcher

2004-08-14 Thread Matt Eaton
ÐÐÑÐÐÑÑÐÑÐÑÐ Michael, and ÐÐÐÑÐÐÐ. However, it didn't work. Whole thing still takes about 1 second. On the other hand, I realized I'm an idiot and that the reason it was running so fast when I handled temporary tables myself is that I was using mysqlcc, which truncated the first table to 1000

Re: MYSQL RECORDS AND ALPHABETICAL ORDER

2004-08-14 Thread Martijn Tonies
Hi, > Dear friends, > In this query what precisely needs to be added at alphabetical_field > following ORDER BY > > SELECT * FROM mytable ORDER BY alphabetical_field > so that I get output in alphabetical order. > > guidance, please. I highly suggest reading a book (any book) on SQL (not MySQL

RE: MYSQL RECORDS AND ALPHABETICAL ORDER

2004-08-14 Thread Sunmaia
Hi replace alphabetical_field with the name of the field you are ordering by. If you are not sure, post your table structure and I will add it for you :) bfn Peter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 14 August 2004 19:06 To: [EMAIL PROTECTE

Re: MYSQL RECORDS AND ALPHABETICAL ORDER

2004-08-14 Thread Remember14a
Dear friends, In this query what precisely needs to be added at alphabetical_field following ORDER BY SELECT * FROM mytable ORDER BY alphabetical_field so that I get output in alphabetical order. guidance, please. -- My Php

Re: SQL Query Question

2004-08-14 Thread Michael Stassen
Right. If the employee ID in either the rep_no or entered_by columns does not have a corresponding row in the global_employee table, then the regular join won't match that row. In that case, as you found, you need a LEFT JOIN, which guarantees you get the rows from the table on the left, and

Re: SQL Query Question

2004-08-14 Thread Michael J. Pawlowsky
Thanks a lot Michael. A regular join did not seem to work. But when I tried a LEFT JOIN it worked. A cut down example of it is the following. SELECT global_lead.id, rep_no, es.fname as sales_name, em.fname as marketing_name FROM global_lead LEFT JOIN global_employee es ON global_lead.rep_no = es.i

Re: SQL Query Question

2004-08-14 Thread Michael Stassen
You need to join the employee table twice, once for each id lookup, like this: SELECT es.name AS sales_name, em.name AS marketing_name, leads.id FROM leads JOIN employee es ON leads.salesid = es.id JOIN employee em ON leads.marketingid = em.id; Michael Michael J. Pawlowsky wrote: I

SQL Query Question

2004-08-14 Thread Michael J. Pawlowsky
Im not sure if this is possible or not. I have a Sales leads table. Part of the table has 2 employee_ids. 1. The Sales person the lead is assigned to. 2. The Marketing person that generated the lead. Then there is a employee table that has ids and names. When generating a report for leads I would

Re: MYSQL RECORDS AND ALPHABETICAL ORDER

2004-08-14 Thread Peter Brawley
A defining feature of a relational database is that its data storage is entirely independent of the physical order of rows. To specify row order in a query, use an ORDER BY clause. PB - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 14, 2004

RE: MYSQL RECORDS AND ALPHABETICAL ORDER

2004-08-14 Thread Peter Lovatt
SELECT * FROM mytable ORDER BY alphabetical_field hth Peter > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 14 August 2004 08:57 > To: [EMAIL PROTECTED] > Subject: MYSQL RECORDS AND ALPHABETICAL ORDER > > > Dear Friends, > > I have mysql table which re

Re: MYSQL RECORDS AND ALPHABETICAL ORDER

2004-08-14 Thread Martijn Tonies
Hi, > I have mysql table which retains names,Data is written to mysql table using > php query, however when I check the records, I amn't able to do the same in > alphabetical order. > How do I make mysql to retain records in alphabetical order. With an ORDER BY clause perhaps? With regards, Mar

MYSQL RECORDS AND ALPHABETICAL ORDER

2004-08-14 Thread Remember14a
Dear Friends, I have mysql table which retains names,Data is written to mysql table using php query, however when I check the records, I amn't able to do the same in alphabetical order. How do I make mysql to retain records in alphabetical order. Any guidance, please.

Re: GROUP BY optimization headscratcher

2004-08-14 Thread Михаил Монашёв
Здравствуйте Matt ME> CREATE TABLE `T1` ( ME> `guid` smallint(5) unsigned NOT NULL default '0', ME> `qid` smallint(5) unsigned NOT NULL default '0', ME> `a` tinyint(2) NOT NULL default '-2', ME> `d` tinyint(2) NOT NULL default '-2', ME> KEY `IX_FW_qid` (`qid`), ME> KEY `IX_FW_d` (`d`)

Necessity of recreation of Index

2004-08-14 Thread Smitesh . Damdoo
Hi, Everybody. It's simple question. But i am in confusion. I have table with huge number of records but only 3 columns (suppose col1, col2, col3). col1 is primary key and I have created the Index on the column (i.e. col2) which is not a primary key. Problem 1) is that