Re: query gets count wrong

2004-07-12 Thread Gerald Taylor
I am an anal single query-oholic. I know I could do this in 2 queries I have a query involving several related tables and I have attempted to reduce it down to what causes not what I want results. I am attempting to fill a summary table. For each main item in this table I want to count the number

Re: query gets count wrong

2004-07-12 Thread SGreen
to: 07/12/2004 09:42 Subject: Re: query gets count wrong AM

Re: Query from mulitple tables where data will only be in one table but that table unkown

2004-07-06 Thread Eamon Daly
I don't think I know enough about the tables (is there a primary key) or what the end result should look like (one row per IP address, do you need to know what table matched) to give a very good answer, but a simple UNION will probably get you part of the way there: SELECT DISTINCT 'DIALUP',

Re: Query last record in table

2004-07-05 Thread Paul DuBois
At 13:52 -0500 7/5/04, Mike Blezien wrote: Hello, what is the most effecient way to query the last record in a table, if querying the primary key(acctid) column ?? What do you mean by last? The row containing the largest acctid value? You might try ... ORDER BY acctid DESC LIMIT 1. I've tried

RE: Query last record in table

2004-07-05 Thread Scott Johnson
Hi Tia, I'm not sure, but my old SQL trick was to do a select * top 1 from subscribers order by acctid desc Scotty. -Original Message- From: Mike Blezien [mailto:[EMAIL PROTECTED] Sent: July 5, 2004 2:52 PM To: MySQL List Subject: Query last record in table Hello, what is the most

Re: query problem

2004-06-30 Thread SGreen
Eliminate the rows from outbound_fax_info where the barcode is blank. The result of the JOIN will be all of the rows of inbound_fax_info matched up to: a) information form outbound_fax_info except where the barcodes match b) blank columns where the barcodes didn't match. Use the

Re: query problem

2004-06-30 Thread auslander
Actually, i figured it out. don't know why it was so hard to see it. all i did was change: LEFT JOIN outbound_fax_info b on ucase(a.barcode) = ucase(b.barcode) to: LEFT JOIN outbound_fax_info b on (b.barcode != '' and ucase(a.barcode = b.barcode). if barcode was blank in outbound (b) then

Re: query problem

2004-06-30 Thread SGreen
/2004 02:22 cc: [EMAIL PROTECTED] PM Fax to: Subject: Re: query problem

RE: Query on large text field

2004-06-30 Thread Schalk
Hey there everyone I have tried a couple of things but would like to know what suggestions people on the list may have. What would be the best query term or string is to use when searching a field, using a keyword(s), in the database that contains a large amount of text, for example an

RE: Query on large text field

2004-06-30 Thread Victor Pendleton
If the table type is MyISAM, have you tried full text indexing? -Original Message- From: Schalk To: [EMAIL PROTECTED] Sent: 6/30/04 2:31 PM Subject: RE: Query on large text field Hey there everyone I have tried a couple of things but would like to know what suggestions people

Re: Query Help

2004-06-28 Thread SGreen
You need to flip the business table around your join so that you get all of the businesses listed and check for the appropriate NULL values in the other tables. This will give you all of the business that neither have a record in 2004 nor will they be part of package 16 SELECT * FROM business

Re: Query Help

2004-06-28 Thread SGreen
] PM Fax to: Subject: Re: Query Help

RE: Query problem

2004-06-27 Thread Schalk
Why is the following query retuning doctype’s different to what is asked for? SELECT * FROM documents WHERE jstate = 'California: State Court' AND doctype = 'Verdict'   Any ideas? As far as I can see it should only return a document if it is a Verdict and matches the state California: State Court.

Re: Query problem

2004-06-27 Thread Eric Bergen
Post the table structure, what that query it returning and what you think it should return. -Eric On Sun, 27 Jun 2004 23:33:55 +0200, Schalk [EMAIL PROTECTED] wrote: Why is the following query retuning doctype's different to what is asked for? SELECT * FROM documents WHERE jstate =

Re: Query Problem with Lists

2004-06-24 Thread Brent Baisley
You probably shouldn't have setup your database structure like that. You should always break out multiple values into a separate table, each value being stored in one record, then link them through a common record id. A one to many relation. As far as the database is concerned, those aren't

Re: Query Problem with Lists

2004-06-24 Thread Eamon Daly
I believe you could do: SELECT * FROM Table WHERE FIND_IN_SET(number, comma_delimited_field) but this will be /very/ slow. This query is forced to examine each and every row to determine whether or not your number is in the field. The better solution is to break up that field, which is

Re: Query Problem with Lists

2004-06-24 Thread SGreen
I understand how these lists come into existence (trust me I have had to deal with enough of them). However, it is standard practice when working with _relational_ databases to split those lists of numbers into unique record pairs in a separate table. Your original source data was not relational,

Re: Query Problem with Lists

2004-06-24 Thread Eric Scuccimarra
I understand why we would want these to be in relational forms but in this situation it isn't practical for a number of reasons. Normally that would be what I would do. However in this case the nature of the application is such that doing this would cause an enormous load on the system as we

Re: Query Help

2004-06-16 Thread Michael Stassen
Robert A. Rosenberg wrote: At 12:22 +0100 on 06/11/2004, Andrew Dixon - MSO.net wrote about Query Help: Hi Everyone. I have the following a table with a varchar column that contains a comma delimited list of id's from another table that relates the item keywords in the other table. The table

Re: query in any table

2004-06-16 Thread Michael Stassen
Yavuz Malak wrote: I use mysql3.53.x I wish to query as value of rows on any table Here's my table named mytable id date pictures subject 271503 2003-10-25 20031026035655_5326 9 BENY 271502 2003-10-25 20031026035628_6401 283 PLATFORMU 271501 2003-10-25

Re: Query Help

2004-06-15 Thread Robert A. Rosenberg
At 12:22 +0100 on 06/11/2004, Andrew Dixon - MSO.net wrote about Query Help: Hi Everyone. I have the following a table with a varchar column that contains a comma delimited list of id's from another table that relates the item keywords in the other table. The table keywords contains keyword_id

Re: Query Help

2004-06-14 Thread Michael Stassen
First, you really should add a gallery_keywords relationship table to replace the galleries.keywords column. Aside from the difficulties you are already having, I don't think any solution with the current scheme will be able to make full use of indexes, if at all. In other words, without an

RE: Query Help

2004-06-11 Thread Dean Urmson
For example: gallery_id | gallery_name | keywords 1 | test | 1,2,3,4 2 | test2| 3,4,5,6 And I won't to get all the galleries with where the have the keywords 2, which in this case would be record 1 or keyword 4 which would be both record. SELECT

RE: Query Help

2004-06-11 Thread Andrew Dixon
] Subject: RE: Query Help For example: gallery_id | gallery_name | keywords 1 | test | 1,2,3,4 2 | test2| 3,4,5,6 And I won't to get all the galleries with where the have the keywords 2, which in this case would be record 1 or keyword 4 which would be both

RE: Query Help

2004-06-11 Thread Dean Urmson
Already tried that, but is 2 appears at the end of the list is doesn't get picked up because there is no comma at the end of the list Are there spaces between the commas??? If not then SELECT gallery_id, gallery_name FROMgalleries WHERE keywords = '2'--

RE: Query Help

2004-06-11 Thread Andrew Dixon
- From: Dobromir Velev [mailto:[EMAIL PROTECTED] Sent: 11 June 2004 12:58 To: Andrew Dixon - MSO.net; [EMAIL PROTECTED] Subject: Re: Query Help Hi, You could use either something like this SELECT gallery_id, gallery_name FROM galleries g WHERE keywords rlike

Re: query with escape characters

2004-05-28 Thread daniel
Hi, How can I make a query that looks for a city that has a ' in the name? For instance, I am looking for the name S'ARENAL, but the query below does not work: SELECT intl_localidades.id, intl_localidades.codigo_pais, intl_localidades.localidad_es,intl_zonas.zona,intl_paises.pais_es FROM

Re: query with escape characters

2004-05-28 Thread gerald_clark
It depends on what language you are using to send the query. If you are using the shell, 'S\'ARENAL' parses to 'S'ARENAL' before it is sent to the server. You will need to escape the escape character. 'S\\'Arenal' or maybe even 'S\\\'Arenal' or 'S'ARENAL' It depends on how many parsers

Re: query to see if db exists...........mysql_query( myQuery)

2004-05-28 Thread Stephen E. Bacher
On Thu, May 27, 2004 at 03:59:46PM -0400, Bono, Saroj AA R62 wrote: I am going to use mysql_query() and want to find out if a certain database exists. If mysql_real_connect() fails there are many errors that could account for this. The database may exist , and I cant take the error returned

Re: query to see if db exists...........mysql_query( myQuery)

2004-05-27 Thread Jim Winstead
On Thu, May 27, 2004 at 03:59:46PM -0400, Bono, Saroj AA R62 wrote: I am going to use mysql_query() and want to find out if a certain database exists. If mysql_real_connect() fails there are many errors that could account for this. The database may exist , and I cant take the error returned

Re: Query help

2004-05-25 Thread Ryan Fox
On Tue, 25 May 2004 11:50:11 +0100, Paul Owen [EMAIL PROTECTED] wrote: What I have so far is: from people, invoice, payments where people.pid=invoice.pid and people.pid=payments.pid group by people.pid; Though it doesn't fix the problem you're asking about, I wanted to note that you'll

RE: Query question

2004-05-25 Thread Amit_Wadhwa
Select count(distinct(field)) from table where field = 0 ? -Original Message- From: Laercio Xisto Braga Cavalcanti [mailto:[EMAIL PROTECTED] Sent: Monday, May 24, 2004 11:18 PM To: 'John Nichel'; 'MySQL List' Subject: RE: Query question You can do: Select count(distinct(field)) from

Re: Query question

2004-05-24 Thread mos
At 12:36 PM 5/24/2004, you wrote: Hi, I have a table which I want to select data from (obiviously). In this table, I have a field which is an integer, and defaults to 0. What I would like to do is count all rows in that table which not only equals 0 for the field, but has a distinct value

Re: Query question

2004-05-24 Thread John Nichel
Rich Allen wrote: iH this should work test select * from xt; ++---+ | id | field | ++---+ | 1 | 0 | | 2 | 0 | | 3 | 7 | | 4 | 8 | | 5 | 7 | | 6 | 0 | | 7 | 6 | | 8 | 7 | | 9 | 8 | ++---+ 9 rows in set (0.00 sec) test select

RE: Query question

2004-05-24 Thread Laercio Xisto Braga Cavalcanti
You can do: Select count(distinct(field)) from table where field 0 Laercio. -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: segunda-feira, 24 de maio de 2004 14:37 To: MySQL List Subject: Query question Hi, I have a table which I want to select data from

Re: Query question

2004-05-24 Thread Garth Webb
On Mon, 2004-05-24 at 11:32, John Nichel wrote: Rich Allen wrote: iH this should work test select * from xt; ++---+ | id | field | ++---+ | 1 | 0 | | 2 | 0 | | 3 | 7 | | 4 | 8 | | 5 | 7 | | 6 | 0 | | 7 | 6 | | 8

Re: Query question

2004-05-24 Thread Rich Allen
Garth, good catch! - hcir mysql - hcir On May 24, 2004, at 1:05 PM, Garth Webb wrote: On Mon, 2004-05-24 at 11:32, John Nichel wrote: Rich Allen wrote: iH this should work test select * from xt; ++---+ | id | field | ++---+ | 1 | 0 | | 2 | 0 | | 3 | 7 | | 4 | 8

Re: Query question

2004-05-24 Thread Rich Allen
iH this should work test select * from xt; ++---+ | id | field | ++---+ | 1 | 0 | | 2 | 0 | | 3 | 7 | | 4 | 8 | | 5 | 7 | | 6 | 0 | | 7 | 6 | | 8 | 7 | | 9 | 8 | ++---+ 9 rows in set (0.00 sec) test select count(distinct(field))

RE: Query question

2004-05-24 Thread Lopez David E-r9374c
John Try select field, count(*) from db.table group by field; David -Original Message- From: John Nichel [mailto:[EMAIL PROTECTED] Sent: Monday, May 24, 2004 10:37 AM To: MySQL List Subject: Query question Hi, I have a table which I want to select data from

Re: Query help with grouping and latest date.

2004-05-20 Thread Egor Egorov
Duncan Hill [EMAIL PROTECTED] wrote: I have a table that has data that looks like: ++-+---+-+ | id | recdate | mount | perused | ++-+---+-+ | 1 | 2004-05-20 10:46:12 | QUAR | 80 | | 2 | 2004-05-20

Re: Query help with grouping and latest date.

2004-05-20 Thread Egor Egorov
Egor Egorov [EMAIL PROTECTED] wrote: Duncan Hill [EMAIL PROTECTED] wrote: I have a table that has data that looks like: ++-+---+-+ | id | recdate | mount | perused | ++-+---+-+ | 1 | 2004-05-20 10:46:12 |

Re: Query help with grouping and latest date.

2004-05-20 Thread Duncan Hill
On Thursday 20 May 2004 12:49, Egor Egorov might have typed: Duncan Hill [EMAIL PROTECTED] wrote: I have a table that has data that looks like: ++-+---+-+ | id | recdate | mount | perused | ++-+---+-+

RE: Query help with grouping and latest date.

2004-05-20 Thread emierzwa
Since your on 4.1, give this a try... select * from tbl as a where a.recdate=(select max(b.recdate) from tbl as b where b.id=a.id and b.mount=a.mount) Ed -Original Message- From: Duncan Hill [mailto:[EMAIL PROTECTED] Subject: Re: Query help

Re: query string too long?

2004-05-19 Thread Victoria Reznichenko
Leonardo Francalanci [EMAIL PROTECTED] wrote: I'm using MySql version 4.1.1. When I issue a query like (SELECT * FROM PARTITIONED_1_1 AS PARTITIONED, PARTITIONED2_1 AS PARTITIONED2 WHERE PARTITIONED2.ID=PARTITIONED.ID1) UNION (SELECT * FROM PARTITIONED_2_1 AS PARTITIONED, PARTITIONED2_1 AS

Re: Query Log

2004-05-06 Thread Lou Olsten
5:25 AM Subject: Re: Query Log Lou Olsten [EMAIL PROTECTED] wrote: I'm pretty sure that the answer to this is No, you cannot but I figured I'd check anyway... As I go back through my query log, I'd like to know the user that issued the statement. If the user is still connected, I can

Re: Query Log

2004-05-04 Thread Egor Egorov
Lou Olsten [EMAIL PROTECTED] wrote: I'm pretty sure that the answer to this is No, you cannot but I figured I'd check anyway... As I go back through my query log, I'd like to know the user that issued the statement. If the user is still connected, I can cross reference it with the SHOW

RE: Query Log

2004-05-04 Thread Victor Pendleton
Which query log are you referring to? The user and the host are both logged in the slow query and general logs. -Original Message- From: Lou Olsten To: [EMAIL PROTECTED] Sent: 5/3/04 4:59 PM Subject: Query Log I'm pretty sure that the answer to this is No, you cannot but I figured I'd

Re: Query help

2004-04-27 Thread Richard Reina
Thank you very much Shawn and Mike for your quick responses. Left join was exactly what I was looking for and it worked quite nicely. Once again, thanks for your help. Richard [EMAIL PROTECTED] wrote: Richard, This is the case for using a LEFT JOIN. You want everything from the left table

RE: Query help

2004-04-26 Thread Mike Johnson
From: Richard Reina [mailto:[EMAIL PROTECTED] I have two tables: EVENT IDname date sponsor_ID 23 Sady Hawkins 2004-11-04 235 89 Founders Day 2004-12-21 NULL 87 Winter Gala

Re: Query help

2004-04-26 Thread SGreen
Richard, This is the case for using a LEFT JOIN. You want everything from the left table regardless of if it has a match in the right table. In this case which table is left or right depends on which table name exists to the left of the JOIN clause. This will show you all events regardless if

RE: query mysql data dictionary

2004-04-23 Thread Dathan Vance Pattishall
SHOW KEYS FROM TABLE -Original Message- From: sbv chris [mailto:[EMAIL PROTECTED] Sent: Thursday, April 22, 2004 7:26 AM To: [EMAIL PROTECTED] Subject: query mysql data dictionary Hi, I'm trying to find a way to find the primary keys in a table and find constraints on a table by

Re: query help

2004-04-21 Thread Yonah Russ
I got a response off the list suggesting writing a function to go over the query results- it's not hard but I'd rather do this in sql if possible. I came up with this: select books.bookid,books.title,copies.copyid from books left join copies on books.bookid=copies.bookid where

Re: query help [resend]

2004-04-21 Thread Victoria Reznichenko
Yonah Russ [EMAIL PROTECTED] wrote: Hi, I have two tables- books and copies every book has an id in the books table every copy of a book has the books id and a copy id in the copies table (1 row per copy) I want a list of all the books that don't have any copies meaning all the book

RE: query help

2004-04-21 Thread Matt Chatterley
[mailto:[EMAIL PROTECTED] Sent: 21 April 2004 14:47 To: MySQL List Subject: Re: query help I got a response off the list suggesting writing a function to go over the query results- it's not hard but I'd rather do this in sql if possible. I came up with this: select books.bookid,books.title

Re: Query question

2004-04-21 Thread Don Read
On 21-Apr-2004 Alex croes wrote: I'm trying to select specified data from a field in a table. The field from which the data has to come contains the following: 'something;else;anything;everything;name;my' (and so on), it's a long text. I need in the case just 'my' from the field, thus

Re: Query that crashes MySQL

2004-04-20 Thread Egor Egorov
James Fryer [EMAIL PROTECTED] wrote: I'm using mysql-standard-4.1.0-alpha and I've found a query that consistently crashes the server. The form of the query is this: (SELECT DISTINCT g.id FROM T1 b, T2 g WHERE g.id IN (0) ) UNION ( SELECT DISTINCT b.id FROM T1 b,

RE: Query that crashes MySQL

2004-04-20 Thread Victor Pendleton
What does the explain look like for this query? -Original Message- From: James Fryer To: [EMAIL PROTECTED] Sent: 4/20/04 8:08 AM Subject: Query that crashes MySQL I'm using mysql-standard-4.1.0-alpha and I've found a query that consistently crashes the server. The form of the query is

RE: Query that crashes MySQL

2004-04-20 Thread James Fryer
At 02:48 pm 20/04/04, Victor Pendleton wrote: What does the explain look like for this query? Like this: mysql explain (SELECT DISTINCT g.id - FROM Broadcast b, Genre g - WHERE g.id IN (0) - - ) UNION ( - SELECT DISTINCT b.id - FROM Broadcast b, Genre

Re: Query Speed

2004-04-20 Thread Robert J Taylor
Craig Gardner wrote: Thank you very much. That's what fixed my problem. Robert J Taylor wrote: Can you restrict to Not Null instead of != ? (I.e, can you scrub the data not to have empty strings?). The explain shows 3 extra where calculations per row...that's painful. Great! Glad that

Re: Query about MySQL and Access Permissions to MySQL Database FILES

2004-04-17 Thread Paul DuBois
At 22:39 -0400 4/16/04, Robert A. Rosenberg wrote: I am talking a PHP+MySQL course at my local community college and since this is the first time the course is being offered there are some teething problems with the curriculum. I am posting this query at the request of the instructor. We are

Re: Query 2 DBs

2004-04-15 Thread Martijn Tonies
Hi, 2 DBs sitting on different machines, any idea of how to run the query? Select a.*, b.field1 from computernam.db1.table1 a, computername.db2.table1 b where a.fieldx = b.fieldx where computername is host for DB. As far as I know, you cannot. With regards, Martijn Tonies Database

Re: Query Question

2004-04-15 Thread Richard Davey
Hello, Friday, April 16, 2004, 12:50:21 AM, you wrote: M Is it possible to use a query to select all rows from the table M where Column_Count is greater than Column_TotalCount? M Like this: M SELECT * FROM mytable WHERE Column_Count Column_TotalCount; Perhaps you ought to try it before

Re: Query Question

2004-04-15 Thread MYSQL
I did try it, and it doesn't work, I was looking for Ideas that will work. Hello, Friday, April 16, 2004, 12:50:21 AM, you wrote: M Is it possible to use a query to select all rows from the table M where Column_Count is greater than Column_TotalCount? M Like this: M SELECT * FROM

Re: Query Question

2004-04-15 Thread Paul DuBois
At 16:56 -0700 4/15/04, MYSQL wrote: I did try it, and it doesn't work, I was looking for Ideas that will work. Looks to me like it should work. Try this and see what you get: SELECT Column_Count, Column_TotalCount, Column_Count ColumnTotalCount FROM mytable; That'll show you what's in the

Re: Query in MySQL vs. PERL

2004-04-06 Thread Peter J Milanese
Jack- I think it's pretty much based on preference. I prefer doing everything in epoch, it seems to make it easier for me. This means that the queries would be selecting for business hours, based on epoch time. We do this for our pix logs, web stats, etc... Calculations are much easier this

Re: query-cavhe questions revisited

2004-04-02 Thread Victoria Reznichenko
Mark [EMAIL PROTECTED] wrote: I recently just upgraded to MySQL 4.0.18. I still have a few questions about the new query-cache. Since I am new to the query-cache, I really hope someone has some answers. The documentation says: The FLUSH TABLES statement also flushes the query cache.

RE: Query across two databases on the same server

2004-03-25 Thread Ed Reed
yea, I thought it would be that easy too but it doesn't work. Any other ideas? Peter Lovatt [EMAIL PROTECTED] 3/24/04 3:53:03 PM select db1.table.field, db2.table.field where db1.table.someotherfield = db2.table.someotherfield Peter -Original Message- From: Ed Reed

Re: Query across two databases on the same server

2004-03-25 Thread Egor Egorov
Ed Reed [EMAIL PROTECTED] wrote: yea, I thought it would be that easy too but it doesn't work. It should work. Did you get error message? Any other ideas? Peter Lovatt [EMAIL PROTECTED] 3/24/04 3:53:03 PM select db1.table.field, db2.table.field where db1.table.someotherfield =

Re: Query across two databases on the same server

2004-03-25 Thread Michael Stassen
It really should be that easy, though Peter's example is missing the FROM clause. I'm sure he just meant to show the syntax for db.table.column rather than a complete query. Why don't you tell us what version of mysql you have, the query you tried, and the result you got. Michael Ed Reed

Re: Query across two databases on the same server

2004-03-25 Thread Hassan Schroeder
Ed Reed wrote: yea, I thought it would be that easy too but it doesn't work. Other than the fact that the given example needs a FROM clause, sure it works. What exactly are you trying and what is the exact incorrect result? select db1.table.field, db2.table.field FROM db1.table, db2.table

Re: Query across two databases on the same server

2004-03-25 Thread Ed Reed
I found the problem. There was a hyphen in my database name. Re-created the database and re-imported my data, now everything works fine. Thanks to everyone. Egor Egorov [EMAIL PROTECTED] 3/25/04 8:19:04 AM Ed Reed [EMAIL PROTECTED] wrote: yea, I thought it would be that easy too but it

RE: Query across two databases on the same server

2004-03-24 Thread Peter Lovatt
select db1.table.field, db2.table.field where db1.table.someotherfield = db2.table.someotherfield Peter -Original Message- From: Ed Reed [mailto:[EMAIL PROTECTED] Sent: 24 March 2004 23:45 To: [EMAIL PROTECTED] Subject: Query across two databases on the same server Is there

Re: query question...

2004-03-17 Thread Michael Stassen
Manuele wrote: This might sound silly to many... so sorry in advance... in mysql4 Suppose I have 2 tables: tableA has 3 columns, 2 of them reference the same column of tableB Example: TableA (Items) Id - FirstType - SecondType 0 - 1 - NULL 1 - 2 - 3

Re: query question using REGEXP

2004-03-17 Thread Michael Stassen
You could also do this with REGEXP, using [[::]] and [[::]] which are character classes that match word boundaries, including comma, beginning of line, and end of line. Then finding rows which include 2, for example, would look something like this: SELECT * FROM yourtable WHERE column

Re: Query Optimization [sorted]

2004-03-13 Thread kris burford
I'm trying to sort out a query that identifies images that are not in the story table (structures below). Peter Brawley has kindly pointed me in the right direction with the sql structure (which does work), but I'm getting benchmarks of 5+ seconds on the test data, whereas the live site has

Re: query question using REGEXP

2004-03-13 Thread Matt W
Hi Anthony, You don't need REGEXP for this; LIKE will do. Try something like this: ... WHERE CONCAT(',', Column, ',') LIKE '%,2,%' to search for rows that contain 2. Hope that helps. Matt - Original Message - From: award Sent: Saturday, March 13, 2004 2:16 PM Subject: query

Re: query question using REGEXP

2004-03-13 Thread Matt W
, then the query I gave will work fine for that because it adds a comma to the beginning and end of the column (with CONCAT()) before doing the LIKE comparison. Matt - Original Message - From: award Sent: Saturday, March 13, 2004 5:10 PM Subject: RE: query question using REGEXP Hi thanks

Re: query reference help

2004-03-12 Thread Peter Brawley
Kris, Is ...LIKE '%[img]' + i.image_name + '[/img]%' what you're looking for? PB - Original Message - From: Kris Burford To: [EMAIL PROTECTED] Sent: Friday, March 12, 2004 7:03 AM Subject: query reference help hi i'm having problems trying to write a query that

Re: query reference help

2004-03-12 Thread Peter Brawley
Sorry, my mistake, I think you need CONCAT( '%[img]', i.image_name, '[/img]%' ) PB - Original Message - From: kris burford To: Peter Brawley ; [EMAIL PROTECTED] Sent: Friday, March 12, 2004 8:06 AM Subject: Re: query reference help SELECT i.id, i.image_name

Re: query reference help

2004-03-12 Thread kris burford
SELECT i.id, i.image_name, i.image_width, i.image_height, s.id as story_id, s.title FROM images i LEFT JOIN stories s ON s.body like '[img]' + i.image_name + '[/img]' WHERE i.image_name like '%$search%' ORDER by i.image_name peter wrote: Is ...LIKE '%[img]' + i.image_name +

Re: Query with IF acting wierd.

2004-03-12 Thread Michael Stassen
Mike Johnson wrote: From: Mike Johnson SELECT main.id, IF(main.type,categories.name,items.name), IF(main.type,cat,item) AS type FROM main, IF(main.type,items,categories) WHERE IF(main.type,categories.id,items.id)=main.id; Oh, my mistake. I just realized I reversed items and categories in

Re: Query with IF acting wierd.

2004-03-11 Thread Hans van Dalen
SELECT distinct main.id, etc. etc. At 14:37 11-3-04, you wrote: I have 3 tables: main(id int, type tinyint(1)) categories(id int, name varchar) items(id int, name varchar) I want to select the id and name. If type is 1 then I want to select the name from categories, if type is 0 I want to select

Re: Query with IF acting wierd.

2004-03-11 Thread Amir Hardon
Thanks, but this is just a nicer way to apply my second solution, I'm looking for a more efficient solution (and if someone can than for an explanation - why are the results getting duplicated?) -Amir. On Thursday 11 March 2004 15:40, Hans van Dalen wrote: SELECT distinct main.id, etc.

Re: Query with IF acting wierd.

2004-03-11 Thread Hans van Dalen
Amir, I don't know your table content but if you join two tables eg : table1(id, desc) and table2(id, refid, desc) wich containts: table1: 1 test1 2 test2 table2: 1 1 testbla 2 1 testbla and you select: select id from table1 where table1.id = table2.refid you got two rows (because if you show *

RE: Query with IF acting wierd.

2004-03-11 Thread Mike Johnson
From: Amir Hardon [mailto:[EMAIL PROTECTED] I have 3 tables: main(id int, type tinyint(1)) categories(id int, name varchar) items(id int, name varchar) I want to select the id and name. If type is 1 then I want to select the name from categories, if type is 0 I want to select the name

RE: Query with IF acting wierd.

2004-03-11 Thread Mike Johnson
From: Mike Johnson SELECT main.id, IF(main.type,categories.name,items.name), IF(main.type,cat,item) AS type FROM main, IF(main.type,items,categories) WHERE IF(main.type,categories.id,items.id)=main.id; Oh, my mistake. I just realized I reversed items and categories in the IF clause.

Re: Query INTO OUTFILE Problem

2004-03-10 Thread Egor Egorov
Bessares, Bob [EMAIL PROTECTED] wrote: Hello MYSQL Genii, I am trying to run a query that returns results to a .csv file using mysql's 'INTO OUTFILE'. The problem is whenever I write the file I lose my the field names for each column. For example, when I run the query at command line mysql:

Re: Query Optimization

2004-03-07 Thread Paul DuBois
At 21:55 -0300 3/7/04, Volnei Galbino wrote: Hi, Does anybody know where I can find information about query optimization in MySQL? Of which the techniques that are used? Regards, Volnei Galbino Yes, there's a chapter on optimization in the MySQL Reference Manual.

Re: query date ranges

2004-03-07 Thread Michael Stassen
Kevin Waterson wrote: I have been trying this is several ways, currently I have a mess MySQL 4.1.1 PHP as the interface I have a table of with a date range called seasons. in it I have two date ranges and an amount to be charged for each day in the range 2004-01-01 00:00:00 2004-06-01

Re: query date ranges - step 2

2004-03-06 Thread Kevin Waterson
This one time, at band camp, Kevin Waterson [EMAIL PROTECTED] wrote: seasonDateFrom seasonDateTo seasonRateWeekly 2004-06-02 00:00:002004-10-31 00:00:00 42.86 2004-01-01 00:00:002004-06-01 00:00:00 34.29 When I take a booking I have yet another range

Re: query

2004-03-04 Thread Victor Medina
would you mind being morew specific? On Wed, 2004-03-03 at 23:20, Elly Wisata wrote: Hi *, How to query records that most of the fields are the same value? Izit possible? Thanks in advance ~Elle~ -- |...| | _

Re: query

2004-03-03 Thread Rhino
I don't understand your question. And if I don't understand it, there are probably a lot of others who don't understand it either. Rhino - Original Message - From: Elly Wisata [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 03, 2004 10:20 PM Subject: query Hi *, How

Re: Query cache and queries with non-english characters

2004-03-02 Thread Egor Egorov
G B U [EMAIL PROTECTED] wrote: Recently I've come around that mysql (4.1.0 at least) treats different queries containing non-english characters (in my case characters from cp1251 charset) as the same query and therefore returns wrong results. For example the following queries are regarded as

Re: Query Speed in Terminal vs. PHP

2004-03-02 Thread Daniel Kasak
Chris Fowler wrote: I have a query that is admittedly inefficient in that it is doing multiple OR clauses and joining multiple tables. However, the query runs at an acceptable speed if I am in a terminal session and run the query directly in the terminal. On the other hand, when PHP performs

Re: Query Speed in Terminal vs. PHP

2004-03-02 Thread Saqib Ali
Is index defined on all of your tables? Saqib Ali - http://validate.sf.net (X)HTML / DocBook Validator and Transformer On Tue, 2 Mar 2004, Chris Fowler wrote: I have a query that is admittedly inefficient in that it is doing multiple OR clauses and joining multiple tables.

RE: Query Help

2004-02-29 Thread John Berman
: [EMAIL PROTECTED] Subject: RE: Query Help At 2:45 + 2/29/04, John Berman wrote: Got it working at last SELECT lists_.DescShort_ FROM lists_ WHERE (((lists_.Name_) Not In (select members_.List_ from members_ where members_.EmailAddr_ like (' em ' union SELECT lists_.DescShort_ FROM

Re: Query Help

2004-02-29 Thread Rhino
: Sunday, February 29, 2004 3:54 AM Subject: RE: Query Help Paul Sorry to be a pain. I'm not sure that I understand Select an extra column in each SELECT. SELECT member, ... UNION SELECT non-member, ... Regards John Berman -Original Message- From: Paul DuBois [mailto:[EMAIL

RE: Query Help - Thanks

2004-02-29 Thread John Berman
Rhino This is great it works a treat Thanks Regards John Berman -Original Message- From: Rhino [mailto:[EMAIL PROTECTED] Sent: 29 February 2004 13:40 To: [EMAIL PROTECTED]; 'Paul DuBois' Cc: [EMAIL PROTECTED] Subject: Re: Query Help I hope you don't mind me butting in but your note

Re: Query Help - Thanks

2004-02-29 Thread Michael Stassen
Message- From: Rhino [mailto:[EMAIL PROTECTED] Sent: 29 February 2004 13:40 To: [EMAIL PROTECTED]; 'Paul DuBois' Cc: [EMAIL PROTECTED] Subject: Re: Query Help I hope you don't mind me butting in but your note was sent to the whole group The technique Paul is describing involves adding another

Re: Query Help

2004-02-28 Thread Paul DuBois
At 23:09 + 2/28/04, John Berman wrote: Hi Using MySql 4.x and need some help with a query There are two tables Lists Which holds list name +other stuff Members Which holds list name from above, email address + other stuff I want to list all the lists and then which lists a member is

<    4   5   6   7   8   9   10   11   12   13   >