Re: Is there a way ?

2009-08-17 Thread Martijn Tonies
Hello Miles, I'm a little rusty in my SQL statements, and I'm not all that certain that this can be done. IF I have a field with the contents like: "http://beta.somedomain.com/url/url/url=2"; where 2 is the record ID value. And I need to change the contents of That is rather "unfortuna

Re: Is there a way ?

2009-08-16 Thread Johnny Withers
UPDATE table SET col1=REPLACE(col1,'beta.','www.'); Would do what you would need. On Sun, Aug 16, 2009 at 11:14 AM, m i l e s wrote: > Hi, > > I'm a little rusty in my SQL statements, and I'm not all that certain that > this can be done. > > IF I have a field with the contents like: > > "http:/

Re: Is there a way to load non-native Date type with LOAD DATA

2006-09-03 Thread Brad Jahnke
> I have a pretty large file with a Date column in the format M/D/. > > Is there a way to either change the Date data type in the table or a method > to indicate the date format in the LOAD DATA statement in order to handle > this? If you are using MySQL 5.0.3 or greater, you should be able t

Re: Is there a way to load non-native Date type with LOAD DATA

2006-09-03 Thread Chris W
David Perron wrote: I have a pretty large file with a Date column in the format M/D/. Is there a way to either change the Date data type in the table or a method to indicate the date format in the LOAD DATA statement in order to handle this? in VI the following should work depending on

Re: Is there a way to load non-native Date type with LOAD DATA

2006-09-03 Thread Chris Jones
Use a command line tool to change the date. I am only familiar with perl and it would be a very short script to change to -MM-DD. At 10:48 PM 9/2/2006, David Perron wrote: I have a pretty large file with a Date column in the format M/D/. Is there a way to either change the Date data

Re: is there a way to optimize like '%..%' searches ?

2006-07-01 Thread Asif Lodhi
What about partitioning the database? On 7/1/06, Dan Buettner <[EMAIL PROTECTED]> wrote: Wow, that is a tough one. My question would be, how often is older data really accessed? Could you start incorporating a default date range like "past 3 months" or "past 1 year" into all searches, but al

Re: is there a way to optimize like '%..%' searches ?

2006-06-30 Thread Dan Buettner
Wow, that is a tough one. My question would be, how often is older data really accessed? Could you start incorporating a default date range like "past 3 months" or "past 1 year" into all searches, but allow people to override it if needed? Then if you add an index on the timestamp column it wou

Re: is there a way to optimize like '%..%' searches ?

2006-06-30 Thread Martin Jespersen
It's basically a log that people needs to be able to search with wildcards in... the log grows many thousand records per day and never gets smaller, so searches just gets slower and slower. There is a sort field, the timestamp which is used in the searches, but it only makes the searches lsower

Re: is there a way to optimize like '%..%' searches ?

2006-06-29 Thread Dan Buettner
Bummer, Martin. What more can you tell us about your specific application? What are you storing and searching on, exactly? Any chance you can filter on another column to reduce the number of records that need a string search? Dan On 6/28/06, Martin Jespersen <[EMAIL PROTECTED]> wrote: I was

Re: is there a way to optimize like '%..%' searches ?

2006-06-28 Thread Martin Jespersen
I was too fast there it seems fulltext searches doesn't help after all since i can't use leading wildcards to words :( too bad i loved the speed :/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: is there a way to optimize like '%..%' searches ?

2006-06-28 Thread Martin Jespersen
Indeed fulltext searches was the cure i was looking for. Queries went from over 116 seconds to less than half a second thx for the tip ;) Dan Buettner wrote: Martin, currently there is not a way to optimize that particular type of query. You might consider changing to fulltext indexes and se

Re: is there a way to optimize like '%..%' searches ?

2006-06-28 Thread Peter Van Dijck
Also, perhaps this is good enough for your situation: like 'some%thing%' as opposed to like '%some%thing%' in this case, mysql can use an index on that column and filter out everything that doesn't start with "some". It's a start at least. Peter On 6/28/06, Dan Buettner <[EMAIL PROTECTED]> wrot

Re: is there a way to optimize like '%..%' searches ?

2006-06-28 Thread Dan Buettner
Martin, currently there is not a way to optimize that particular type of query. You might consider changing to fulltext indexes and searches instead, as it could be faster, but it is a slightly different animal from LIKE & so may not fit your needs. http://dev.mysql.com/doc/refman/4.1/en/fulltext

RE: Is there a way

2005-05-17 Thread Berman, Mikhail
Atle, Thank you for your help Mikhail Berman Ives Inc (508)476-7007 ext.27 [EMAIL PROTECTED] -Original Message- From: Atle Veka [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 17, 2005 1:16 PM To: Berman, Mikhail Cc: mysql@lists.mysql.com Subject: Re: Is there a way SELECT ... INTO

Re: Is there a way

2005-05-17 Thread Atle Veka
SELECT ... INTO OUTFILE 'filename' export_options': http://dev.mysql.com/doc/mysql/en/select.html The 'export_options' are the same as this syntax: http://dev.mysql.com/doc/mysql/en/load-data.html That may work for you. Atle - Flying Crocodile Inc, Unix Systems Administrator On Tue, 17 May 200

Re: Is there a way to spell check a DB/column?

2005-04-14 Thread gerald_clark
Ludovic Coumétou wrote: Hello, I have been googling and asking on several forums with no luck, so I'm coming here for the ultimate answer :) eheh Is there a way to spell check a mysql column (or at least table)? Thanks in advance Ludovic Several. 1. Dump - spell check - reload. 2. Write a progra

RE: Is there a way to use LIMIT in both UNION ALL statement and t hen ORDER?

2005-03-28 Thread Tom Crimmins
On Monday, March 28, 2005 21:07, Homam S.A. wrote: > MySQL seems to let me use the LIMIT clause in both > parts of a UNION ALL query, but as soon as I add an > ORDER BY CLAUSE, it gives me a syntax error. > > For example, this query executes fine: > > SELECT * FROM A WHERE X = 1 LIMIT 1000 > UN

Re: Is there a way to use LIMIT in both UNION ALL statement and then ORDER?

2005-03-28 Thread Homam S.A.
Nevermind, I found in the documentation that I need to paranthesize the SELECT parts of the UNION ALL, like this: (SELECT X, Y FROM A WHERE W = 1 LIMIT 1000) UNION ALL (SELECT X, Y FROM B WHERE W = 1 LIMIT 1000) ORDER BY X --- "Homam S.A." <[EMAIL PROTECTED]> wrote: > MySQL seems to let me use

Re: Is there a way to make mysql sgml aware?

2004-05-05 Thread Paul DuBois
At 11:48 -0700 5/5/04, Jeremy Zawodny wrote: On Wed, May 05, 2004 at 02:00:31PM -0300, Leonardo Javier Belén wrote: Hi folks, Is there a way to make mysql sgml aware or any plan to do it in the near time? I think the answer is "no" but I don't really know what that question means. Can you

Re: Is there a way to make mysql sgml aware?

2004-05-05 Thread Jeremy Zawodny
On Wed, May 05, 2004 at 02:00:31PM -0300, Leonardo Javier Belén wrote: > Hi folks, > Is there a way to make mysql sgml aware or any plan to do it in the near > time? I think the answer is "no" but I don't really know what that question means. Can you elaborate? Jeremy -- Jeremy D. Zawodny

Re: Is there a way to find out if a table exists?

2003-09-19 Thread Paul DuBois
At 3:37 PM -0500 9/19/03, Don Read wrote: On 19-Sep-2003 Don Read wrote: On 19-Sep-2003 Dan Anderson wrote: I am trying to make my PHP script autodetect when a table in a mySQL database exists, and when it doesn't, create it. function tableexists($tbl) { $res = @mysql_query("SELECT 1

Re: Is there a way to find out if a table exists?

2003-09-19 Thread Don Read
On 19-Sep-2003 Don Read wrote: > > On 19-Sep-2003 Dan Anderson wrote: >> I am trying to make my PHP script autodetect when a table in a mySQL >> database exists, and when it doesn't, create it. >> > > > function tableexists($tbl) { > $res = @mysql_query("SELECT 1 FROM $tbl"); > retur

Re: Is there a way to find out if a table exists?

2003-09-19 Thread Don Read
On 19-Sep-2003 Dan Anderson wrote: > I am trying to make my PHP script autodetect when a table in a mySQL > database exists, and when it doesn't, create it. > function tableexists($tbl) { $res = @mysql_query("SELECT 1 FROM $tbl"); return ($res ? true : false); } Regards, -- Don Rea

RE: Is there a way to find out if a table exists?

2003-09-19 Thread Jennifer Goodie
> Is there some way to do something like: > > SELECT * FROM tables WHERE name = "table_name"; > > And get a result I could test for truth, and thus run my script? Show tables like 'table_name'; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:htt

Re: Is there a way to find out if a table exists?

2003-09-19 Thread Roger Baklund
* Dan Anderson > I am trying to make my PHP script autodetect when a table in a mySQL > database exists, and when it doesn't, create it. > > Is there some way to do something like: > > SELECT * FROM tables WHERE name = "table_name"; > > And get a result I could test for truth, and thus run my scrip

Re: Is there a way to time queries?

2003-02-25 Thread Zak Greant
On Tue, Feb 25, 2003 at 04:36:23PM -0600, databarn wrote: > Folk, > > Two or three years ago, I was using ASP to access SQL Server 7 and MS > Access databases. There was a stopwatch dll made by CapRock Software > that allowed me to time various elements of my ASP scripts, > particularly the datab