Re: Seeking Opinions

2005-11-25 Thread Johan
ry). This is on very mediocre hardware (AMD Sempron 2600+ with only 512Mb of memory) so performance on a faster computer with more memory should be excellent. HTH, Johan

Re: Seeking Opinions

2005-11-25 Thread Johan
quot;) ) TYPE=InnoDB; This database uses ANSI, hence the quotes around the field names. The index on KeywordID makes it easy to find all images that have a certain keyword attached to it. Good luck, Johan On 11/25/05, Robb Kerr <[EMAIL PROTECTED]> wrote: > > On Fri, 25 Nov 2005 10:44

Re: MySQL hangs each relative poor time

2005-12-15 Thread Johan
t-of-memory Process Killer. This needs to be not turned on when you run a database. No clue how to turn this off though, as I said...not using Linux. Johan

MySql Feature

2002-12-06 Thread Johan
Hello friends, newbie here. 1. I need to know if these features are supported or not by MySql ver 4.05a. - Referencial integrity constraint - Stored Procedure - View - Trigger 2. How to use SSL ? 3. How to add a user that can login from any host ? 4. What are the differences between standard and m

Question

2002-12-08 Thread Johan
Hello, every body I have 2 database server. the second is a copy of the first. It's replication. But there is no connection line because it is not necesery to have an identical copy. Every day, i have to update the second using a self made program. To identified which record has changed,inserted or

Mysql/courier-imap/postfix socket problem

2002-11-06 Thread johan
/var/run/mysqld/mysql.sock For the rest there are a lot of other mysql databases, and they work fine. So I want to find out why the heck he uses mysqld.sock and not mysql.sock. I already tried with ln -s /var/run/mysqld/mysql.sock /var/run/mysqld/mysqld.sock But that didn't help. Anybody a

Re: Insert Select problem

2006-05-04 Thread Johan Höök
Hi Barry, see: http://dev.mysql.com/doc/refman/5.0/en/insert-select.html you cannot insert into a table you're doing select on (same goes for update). Regards, /Johan Barry skrev: I get this error: Fehler in /home/virtual/site4/fst/var/www/html/adminheaven/artikel-vererben-sav

Outfile syntax and out of memory

2006-05-08 Thread Johan Lundqvist
the column names, and any NULL values are exported as "\N". This is a big problem, cause the import function that exist where I send the data only accept the format I get using "mysql < queryfile.sql > outfile.txt". Any help??! Ideas?? Can I in any way format my

Re: Outfile syntax and out of memory

2006-05-08 Thread Johan Lundqvist
would create humongous sql-statements. I might also have wrote it a bit ambigous in my question; I don't want the word "nothing", I really want the field to contain nothing - as in ''. Regards, /Johan - Ua, Sweden George Law wrote: Johan, have you thought about doi

Re: Outfile syntax and out of memory

2006-05-08 Thread Johan Lundqvist
Hi, Where should I increase max_allowed packet?? I get a error from Windows (yes, I know... it's running on a M$-os, not my bad - not my desicion). The results is about 2 - 10 Gb of data. Regards, /Johan Dilipkumar wrote: Hi, Increase max_allowed packet to 1.5 gb and then try to i

Re: How to convert strings to 'proper case' ?

2006-05-09 Thread Johan Lundqvist
2006 1:16am An example of how to make the first letter in a string uppercase - analogous to UCFIRST SELECT CONCAT(UPPER(SUBSTRING(firstName, 1, 1)), LOWER(SUBSTRING(firstName FROM 2))) AS properFirstName /Johan C.R.Vegelin wrote: Hi List, I want to convert strings to proper-case, where on

Re: How to solve this problem?

2006-05-09 Thread Johan Lundqvist
First I would advice you to take a closer look at: http://dev.mysql.com/doc/refman/5.0/en/join.html It will answer your question. /Johan ??? wrote: Hi There is a schema example below: (From "A first course in database system") Product (maker, model,type) Pc (model, speed, r

Re: How to convert strings to 'proper case' ?

2006-05-09 Thread Johan Lundqvist
My God! Rhino, that was a very long and very good answer!! Impressive!! /Johan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: 1' and '1' or '1

2006-05-10 Thread Johan Lundqvist
for a brief explanation and several links to further info. http://en.wikipedia.org/wiki/SQL_injection /Johan Critters wrote: Hi A user was able to log into my site using: 1' and '1' or '1 in the username and password box. I ran the query SELECT * FROM members WHERE name

Re: query help-multiple joins

2006-05-23 Thread Johan Höök
Hi, I guess you should be able to do something like: SELECT t1.term_id, t1.name, r.type_id, t2.term_id, t2.name FROM term t1 LEFT JOIN relationTerm r ON r.term_id1 = t1.term_id LEFT JOIN term t2 ON r.term_id2 = t2.term_id /Johan mel list_php skrev: Hi! I'm stuck with a join query..

Re: case sensitive table names in mysql-5.0.21

2006-05-30 Thread Johan Höök
-find-table.html /Johan Digvijoy Chatterjee skrev: Hello, I am using MySql-5.0.21 on Suse-Linux-10, i created tables using lowercase names for example ; mysql> create table a (id int); Query OK, 0 rows affected (0.04 sec) mysql> select * from A; ERROR 1146 (42S02): Table 'mysql.A' doesn&

Re: Order by

2006-08-04 Thread Johan Höök
Hi Chris, what you can do is: SELECT [fields] FROM [table] WHERE id IN (id1,id2,id3...) ORDER BY FIELD([field],value1,value2,value3,...) /Johan Chris Sansom skrev: Yes, I have looked at the docs and can't find what I'm looking for. I'm doing a very simple query: SELECT [fiel

Re: Group by base on latest time field, possible?

2006-08-10 Thread Johan Höök
--- Begin Message --- Hi, what you want is probably described in: http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html /Johan The Nice Spider skrev: not works. it's still show same result. any idea? - Original Message - From: "Quentin Bennett

Re: Return list where no data exists

2006-08-21 Thread Johan Höök
Hi Neil, what you need is a LEFT JOIN: SELECT a.* FROM TableA a LEFT JOIN TableB b ON a.ID = b.ID (assuming ID is what you relate the tables on ) WHERE b.ID IS NULL; should hopefully do what you want. /Johan Neil Tompkins skrev: Hi, I've two tables.

Re: Conditional Insert

2006-08-28 Thread Johan Höök
Hi Ravi, you can take a look at: http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html which might take care of your problem. /Johan Douglas Sims skrev: Hi Ravi You are correct. I was just sitting here thinking about this after I sent that and realized that what I said was

Re: Question about COUNT()

2006-09-11 Thread Johan Höök
JOIN x_ref AS b ON (b.type=a.id) AND b.verified=1 GROUP BY a.Id it should work. /Johan Jørn Dahl-Stamnes skrev: Assume the following tables: CREATE TABLE x_type ( idmediumint unsigned not null auto_increment, name char(20), primary key (id) ) INSERT INTO x_type (id,name

Re: storing URL 2083 characters

2006-09-12 Thread Johan Höök
Hi Peter, I'd thought I'd just mention that the varchar length depends on your MySQL version and character set. 5.0.3 and later handles upto 64k chars. See: http://dev.mysql.com/doc/refman/5.0/en/char.html /Johan Peter Van Dijck skrev: Hi, URL's have a practical limit of 208

Re: COUNT question

2006-09-18 Thread Johan Höök
GROUP BY a.Id UNION ALL SELECT a.Id AS Id, 0 AS Bid, COUNT(c.Id) AS Cid FROM tablea a LEFT JOIN tablec c ON c.a_ref=a.id GROUP BY a.Id ) AS tabled GROUP BY Id There is more then one select, but only one query... /Johan Jørn Dahl-Stamnes skrev: I have a

Re: Find all rows with no matching rows in second table

2006-09-20 Thread Johan Höök
Hi André, you can do it like: SELECT a.* FROM tablea a LEFT JOIN tableb b ON b.a_id = a.a_id AND b.flag = 'y' WHERE b.b_id IS NULL; /Johan André Hänsel skrev: Hello list, I have two tables: Table A a_id name 1a 2b 3c Table B b_id a_id flag name 12yx 22

Re: Find all rows with no matching rows in second table

2006-09-21 Thread Johan Höök
.a_id b.b_id 1 NULL 2 1 3 NULL you then apply the where and end up with 1 and 3. As long as you every restriction in the JOIN clause and only the IS NULL in the where clause it should work. /Johan mos skrev: At 03:16 AM 9/20/2006, Johan Höök wrote: Hi André, you can do it like:

Re: Find all rows with no matching rows in second table

2006-09-21 Thread Johan Höök
id AND b.flag = 'y' WHERE b.b_id IS NULL; /Johan Jerry Schwartz skrev: What about SELECT tablea.* FROM tablea AS a JOIN tableb AS b ON a.a_id = b.a_id WHERE b.b_id IS NULL OR b.flag != "Y"; The WHERE clause should exclude existing records where the flag is Y, include existi

Re: MySQL operators

2006-09-21 Thread Johan Höök
ainst "like '%'" you should remove those terms as they always will be true. /Johan molemenacer skrev: I have a query that searches on a number of criteria and would like help on the last line I have included my code below: where jobs.statusid in (6) and ifnull(jobs.currwor

Re: Requesting help with subquery

2006-09-26 Thread Johan Höök
Hi Kevin, I didn't look that close at it but it should be IFNULL, not ISNULL which is SQLserver's version of it. /Johan Zembower, Kevin skrev: I'm trying to use a subquery for the first time, and am having some problems. I'm hoping someone can give me some suggestions on

Re: Help with SQL Queries

2006-10-04 Thread Johan Höök
ELECT p.id AS Id, p.name AS Name, 0 AS Cars, COUNT(h.id) FROM person p LEFT JOIN house h ON h.person_id=p.id GROUP BY p.id)) AS tablea GROUP BY Id HTH, /Johan select * from person ++-+ | id | name | ++

Re: need auto increment value

2006-10-11 Thread Johan Höök
ln("My autoincrementid is: " + rs.getInt(1)); /Johan balaraju mandala skrev: Hello Everybody, i want to read the latest value of a autoincrement column from a java program. How can i do this? i want to do this in a single query insertion, is it possible? -

Re: Query ignoring index

2006-11-02 Thread Johan Höök
xplain.html for more. /Johan Jonathon Wardman skrev: Hello, I've been working on some queries with a large dataset (7.5 million rows) and have been finding problems with indexes seemingly being ignored for some queries - this obviously slows the query right down, I've seen some quer

Re: Wanted: Help with 'ON DUPLICATE KEY' syntax

2005-06-30 Thread Johan Höök
column in the INSERT list will make it work. ... I've run into it myself on 4.1.12. /Johan Siegfried Heintze wrote: Thanks for deciphering that terrible message, Shawn. I accidentally must have hit the paste key too many times. Anyway, here is my new insert statement: INSERT INT

Re: Wanted: Help with 'ON DUPLICATE KEY' syntax

2005-06-30 Thread Johan Höök
Hi Jocelyn, you're right of course. I didn't read the original post closely enough (it's early in the morning here...). I missed that SELECT wasn't used. Regards, /Johan [EMAIL PROTECTED] wrote: Hi Johan, I don't think it's its problem, since MySQL return

Re: Order By Question

2005-08-17 Thread Johan Höök
Hi, the basic thing is that you must never assume anything on what order you're getting your rows back if you're not using an order by. This said I guess one way for you to do this is to add a row-number column, preferbly auto-increment, and then order by that column. /Johan Sch

Re: INSERT IGNORE Doesn't Seem To Work

2005-08-24 Thread Johan Höök
s the errorhandling of a UNIQUE KEY violation. Regards, /Johan Hal Vaughan wrote: I may have a misunderstanding of this, but as I have been told, if I have a table with 3 columns, Idx (an Index column, unique, auto-increment), Name, Value (both varchar), and I try a command like this: I

Re: Copying data stored in different field formats from one table to another

2005-09-12 Thread Johan Höök
ofpic, hofbio, nickname, contactMe, showMe, websiteUrl ) VALUES (MD5('temp'), UNIX_TIMESTAMP( joindate ) , CONCAT_WS( ' ', firstname, lastname ) , id, username, email, active, keitai, number, admin, cardpic, cardbio, hofpic, hofbio, nickname, contactMe, showMe, website)FROM me

Re: Copying data stored in different field formats from one table to another

2005-09-12 Thread Johan Höök
; in the CONCAT_WS defaults to latin1_swedish_ci. Hope this helps, /Johan Dave wrote: I think your problem is that you're trying to call one of your columns MD5(passwd) Thank you for pointing that out. I had the function in the wrong part of the statement. Actually, I've real

Re: Copying data stored in different field formats from one table to another

2005-09-12 Thread Johan Höök
Dave, I've tried SET collation_connection = utf8_general_ci; on my server (4.1.14) and it seems to work so I'm afraid I can't help you anymore there. /Johan Dave wrote: My hunch here is that your ' ' in the CONCAT_WS defaults to latin1_swedish_ci. It seems you&

Re: I forgot the admin password

2005-09-21 Thread Johan Höök
Hi Luis, you can start your server with --skip-grant-tables see: http://dev.mysql.com/doc/mysql/en/privileges-options.html /Johan Luis Garay wrote: hi im pretty newbie in mysql. i installed this in my computer few weeks ago and today i want to begin practicing and i cant log in . i suppose i

Re: Duplicate column error when creating view on 5.0.13

2005-10-07 Thread Johan Höök
Hi Terence, I think your problem lies in your SELECT * If you look at the columnheaders below you get category_id twice. I guess you have to specify your columns with aliases. /Johan SELECT * FROM ticket_master tm, category_master cm WHERE tm.category_id = cm.category_id

Re: Duplicate column error when creating view on 5.0.13

2005-10-07 Thread Johan Höök
ry_id,category_id,category_name when MySQL deduces what to use for columnnames in the view. /Johan Terence wrote: Johan Höök wrote: Hi Terence, I think your problem lies in your SELECT * If you look at the columnheaders below you get category_id twice. I guess you have to specify your columns with al

Re: How can I do?

2005-10-31 Thread Johan Höök
Hi Priscilla, you can do: SELECT (SELECT SUM(t1.field) FROM table1 t1) + (SELECT SUM(t2.field2) FROM table t2) + (SELECT SUM(t3.field3) FROM table t3) /Johan Priscilla Labanca wrote: Hi, guys! I need to sum three fields of three different tables how can I do? Thank you

Re: Help with an SQL query

2005-11-04 Thread Johan Höök
(LPAD(Population,10,'0'),Name)),10) AS Population -> From Country -> Group By Continent -> Order By Population DESC; - /Johan Gobi wrote: Gobi wrote: Arno Coetzee wrote: Gobi wrote: Not sure if this is the right place to ask. I have a table, Weight

Re: Help with an SQL query

2005-11-04 Thread Johan Höök
format, you might run into problems with that I guess. Also you might have to play with lengths a bit. /Johan Gobi wrote: Johan Höök wrote: Hi Gobi, there was a similar posting in august. See: http://lists.mysql.com/mysql/187436 which I think describes what you want. I'll include a bit of

Re: High Performance MySQL on Amazon

2006-01-12 Thread Johan Höök
Hi Ian, if you look closer at the picture of the second you'll see that it's the German version of the book. /Johan Ian wrote: Hi, On Amazon uk there are two versions of the book "High Performance MySQL ": 1st: High Performance MySQL ~Jeremy D. Zawodny, Derek Balling

Re: update statements problem

2006-03-20 Thread Johan Höök
The way you have you'll get an update as soon as products_model="5217-01" /Johan cybermalandro cybermalandro wrote: I am trying to update a table with a file that has more than one update statements like this: UPDATE products set products_price="22.00" WHERE products_model=&quo

Re: Cannot restart service MySQL

2006-03-31 Thread Johan Lundqvist
In Windows, you have 3 alternatives: 1 - wait untill it stops the service (can take very long time). 2 - restart the server (your users might cry a bit). 3 - Try to kill the task using Task Manager (this might not work, depending on the service). /Johan Sara Woglom wrote: Please help, I

How to merge my tables?

2006-03-31 Thread Johan Lundqvist
314 | 343 | 649 | ... 1004 |NULL | 96 | 147 | ... I've tried everything and I'm out of clues. Can it be done?? If so, how??? Any help/tips are very welcome!! /Johan, Uppsala - Sweden -- MySQL General Mailing List For list archives: http://

Re: How to merge my tables?

2006-03-31 Thread Johan Lundqvist
rmation is prohibited. If you have received this transmission in error, please notify the sender by reply e-mail and destroy all copies of this transmission. -Original Message----- From: Johan Lundqvist [mailto:[EMAIL PROTECTED] Sent: Friday, March 31, 2006 1:13 PM To: mysql@lists.mysql.com Subje

Re: How to merge my tables?

2006-03-31 Thread Johan Lundqvist
). I'll look in to it tomorrow, it's in the midddle of the night here and soon my backup system will start = no access to my server... Thanx again, this really got my out of my mindlock. Regards, /Johan Shaunak Kashyap wrote: OK. No problem. We can hopefully still make this w

How to avoid Using temporary; Using filesort

2009-01-14 Thread Johan Thorvaldsson
I have a query that runs very slow and using Using temporary; Using filesort. Is there a way to avoid them using current table structure? Goal with the query is to find ads (ad_id) that have tags (tag_id) connected to them, order by "antal" is used to get the most relevant first. ( the one that con

Re: How to avoid Using temporary; Using filesort

2009-01-14 Thread Johan Thorvaldsson
Not really, the query took 4-5 seconds. The query runs through 13910 rows according to explain, that isnt alot is it? SELECT COUNT(*) antal,ad.ad_id FROM ad INNER JOIN tag_ad_map tm ON tm.ad_id=ad.ad_id WHERE tm.tag_id IN (99, 10807, 20728, 21, 135) AND ad.is_removed = 0 AND ad.is_active=1 AND

Re: insert warning - how to look at

2009-10-30 Thread Johan Andersson
Hi, mysql> show warnings; BR johan Sydney Puente wrote: Hello, I have an application which is inserting rows into a Mysql 5.024 db. It seems to stop when an insert generates a warning. when I insert the suspect line on the mysql commandline I get this: Query OK, 1 row affected, 1 warn

Re: MySQL being hacked with commands through URL

2009-11-18 Thread Johan Gant
major problem sounds like query structure and how you process your forms. Filter your input and structure your queries correctly to prevent this from happening. Run SQL Injection through any search engine and you should have no problem finding resources to cover yourself against this kind of vulnera

When using "FOR UPDATE" whole the table seems to lock instead of selected row

2010-01-14 Thread Johan Machielse
tock.Quantity = Stock.Quantity - 1 WHERE Stock.ProductID = 1 AND Stock.SizeID = 2; 10) Session 2: COMMIT; Regards, Johan Machielse Machielse Software http://www.machielsesoftware.nl

Re: When using "FOR UPDATE" whole the table seems to lock instead of selected row

2010-01-14 Thread Johan Machielse
such a problem? Thank you in advance. Regards, Johan Machielse - Original Message - From: "Baron Schwartz" To: "Johan Machielse" Cc: Sent: Friday, January 15, 2010 3:14 AM Subject: Re: When using "FOR UPDATE" whole the table seems to lock instead of s

RE: More CPU or More RAM?

2010-04-21 Thread Johan Gant
ching, or if you have any custom modules - look at whether you can add an appropriate index to any of the tables. Of course, if you want to throw more hardware at the problem it might help in the short run but it might be masking the original problem. Regards, Johan -Original Message-

RE: More CPU or More RAM?

2010-04-21 Thread Johan Gant
I guess this is a DB list, but I strongly disagree with Johan's suggestion to avoid using Views or Taxonomy. The advantages far outweigh the disadvantages in most cases. -Original Message- From: vegiv...@gmail.com [mailto:vegiv...@gmail.com] On Behalf Of Johan De Meersman Sen

Re: Sort results by order in list

2007-10-30 Thread Johan Höök
Hi, what you probably want is SELECT id, start_date FROM iddt WHERE id IN ('109k7','s3x6','sxmns','wt57') ORDER BY FIELD(id,'109k7','s3x6','sxmns','wt57') /Johan Papalagi Pakeha skrev: On 10/30/07, Sebastian Men

Query runs very sloooow

2008-03-05 Thread Johan Thorvaldsson
I need help to optimize this following query. It runs very slow and I cant find any direct errors in it. SELECT 1 * t1.termfreq as viktatantal, t1.tag, t1.url FROM tag_keys t1 LEFT JOIN tag_ad_map tm1 ON t1.id = tm1.tag_id LEFT JOIN tag_ad_map tm2 ON tm1.ad_id = tm2.ad_id LEFT JOIN tag_keys t2 ON t

Re: Query runs very sloooow

2008-03-05 Thread Johan Thorvaldsson
SIMPLE tm2 eq_ref PRIMARY PRIMARY 8 rubbetdev.t2.id,rubbetdev.tm1.ad_id 1 Using where; Using index 2008/3/5, Baron Schwartz <[EMAIL PROTECTED]>: > > Hi, > > > On Wed, Mar 5, 2008 at 9:11 AM, Johan Thorvaldsson <[EMAIL PROTECTED]> > wrote: > > I need help to optimiz

Re: Query runs very sloooow

2008-03-05 Thread Johan Thorvaldsson
NULL default '0', PRIMARY KEY (`id`), KEY `url` (`url`) ) ENGINE=MyISAM AUTO_INCREMENT=11374 DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci 2008/3/5, Baron Schwartz <[EMAIL PROTECTED]>: > > Hi, > > > On Wed, Mar 5, 2008 at 9:11 AM, Johan Thorvaldsson <[EMAIL

Re: insert select

2008-04-03 Thread Johan Höök
Hi Hiep, you can put in either xxx = NULL or you can skip it completely: insert into tbl_1(fld2,fld3) select fld_b, NOW() from tbl_2; Regards, /Johan Hiep Nguyen skrev: hi all, i have a question on insert ... select statement. tbl_1(fld1,fld2,fld3, ) fld1 int primary key

Re: insert select

2008-04-03 Thread Johan Höök
Hi Hiep, Hiep Nguyen skrev: On Thu, 3 Apr 2008, Johan Höök wrote: Hi Hiep, you can put in either xxx = NULL or you can skip it completely: insert into tbl_1(fld2,fld3) select fld_b, NOW() from tbl_2; Regards, /Johan Hiep Nguyen skrev: hi all, i have a question on insert ... select

Re: Query runs very sloooow

2008-04-11 Thread Johan Solve
; > PRIMARY KEY (`tag_id`,`ad_id`) > > > ) ENGINE=MyISAM DEFAULT CHARSET=utf8 > > > > > > CREATE TABLE `tag_keys` ( > > > `id` int(11) NOT NULL auto_increment, > > > `tag` varchar(32) collate utf8_swedish_ci NOT NULL default '', >

Re: WHERE .... IN

2008-07-24 Thread Johan Gant
ich may involve normalising your tables. Also, if this is a field of type int you may need to cast your data as varchar to perform wildcard searches. Regards Johan Gant 2008/7/23 Ali Deniz EREN <[EMAIL PROTECTED]>: > Hi all, > > I have a problem as below: > > A text field -Lets call i

locked file mysqld-nt.exe when re-installing mysql on windows server

2008-07-29 Thread Johan Gant
L? I'm happy to hear alternative suggestions as well. Thanks Johan

Re: locked file mysqld-nt.exe when re-installing mysql on windows server

2008-07-30 Thread Johan Gant
ces---> delete all mysql > entries. Do the same for controlset002 and controlset003 > > After above is done try to delete the file in C:\mysql\bin folder. > > regards > anandkl > > > On 7/30/08, Johan Gant <[EMAIL PROTECTED]> wrote: >> >> Hi >> I

Re: Why dont my query use the index keys?

2008-09-17 Thread Johan Thorvaldsson
mysql> show global variables like 'sort%'; +--+-+ | Variable_name| Value | +--+-+ | sort_buffer_size | 4194296 | +--+-+ 1 row in set (0.01 sec) 18 sep 2008 kl. 08.05 skrev chandru: Hi Johan, the query i

Re: linq with mysql

2008-11-25 Thread Johan Höök
Hi, you're using Sqlserver syntax for handling reserved words. In MySQL you use backtick` for the same, i.e. select `t0`.`amount` etc. /Johan Sharique uddin Ahmed Farooqui skrev: Hi, I'm using VS Express 2008, and trying to use linq with Mysql.What I have done 1. Created a

Re: UPDATE and INSERT in one

2007-04-20 Thread Johan Höök
Hi, what you want to look into is (depending on your version) either "INSERT ... ON DUPLICATE KEY UPDATE ..." or REPLACE http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html http://dev.mysql.com/doc/refman/5.0/en/replace.html /Johan [EMAIL PROTECTED] skrev: Hi, I want t

Re: Unknown column error after upgrading from 4.0 to 5.0

2007-08-29 Thread Johan Höök
processed, group the first two tables explicitly with parentheses so that the operands for the ON clause are (t1,t2) and t3: End excerpt. /Johan Federico Giannici skrev: Since we upgraded from MySQL 4.0 to 5.0 (under OpenBSD 4.1 amd64) the following command: select count(*) as total from pro

Re: Syntax for Compound "IF" Statements?

2005-02-08 Thread Johan Höök
Hi, I guess your "CASE" statement should look something like: CASE WHEN Location=1 THEN 'Downstairs Cat Room' WHEN Location=2 THEN 'Kitten Room' WHEN Location=3 THEN 'Quarantine' ELSE 'Unknown' END AS Location /Johan Sue Cram wr

Re: auto-increment field stops working

2005-02-14 Thread Johan Höök
Hi, could you check to make absolutely sure that your taskId column isn't tinyint, which should explain it as it's max ( being signed ) is 127. /Johan mel list_php wrote: Hi list, I have a very strange (and worrying..!!!) problem with my tables. I'm running a 4.0.9 gamma (no choice

Re: last_insert_id

2005-02-15 Thread Johan Höök
Hi, You can probably use "SELECT LAST_INSERT_ID()" which keeps auto-increment values on a per connection basis. See: http://dev.mysql.com/doc/mysql/en/getting-unique-id.html /Johan mel list_php wrote: Hi! I have a database where several users can connect and input data. I managed to have

Re: How to make so I only need to specify the id once..

2005-02-21 Thread Johan Höök
Hi, why not try: SELECT COUNT(s.Id)+COUNT(se.Id) FROM subs s INNER JOIN subs_erased se ON s.Id=se.Id WHERE s.Id=1; /Johan Joppe A wrote: Hello, I have a small problem that is probably easy to fix but it is to advanced for me as a "newbe". In my sql-query (below) have I the ID specifie

Re: How to make so I only need to specify the id once..

2005-02-21 Thread Johan Höök
Hi Martijn, yes of course you're right but SELECT COUNT(s.Id)+ (SELECT COUNT(se.Id) FROM subs_erased se WHERE s.Id=se.Id) FROM subs s WHERE s.Id=1 might work, at least in 4.1.x. I did test it with 4.1.9. /Johan Martijn Tonies wrote: Hi, why not try: SELECT COUNT(s.Id)+COUNT(se.Id) FROM

Logfile verbosity

2005-02-22 Thread Johan Jonkers
Hi, I was wondering if there is a way to specify how verbose the logfile should be in my.cnf. I've tried searching the manual and google, but have not yet found anything (besides the -v commandline option but thats not it). Any helpd and.or pointers would be greatly appreciated. Johan --

Re: error message when creating tables

2005-03-04 Thread Johan Höök
Hi, according to the manual: http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html 150 is "a foreign key definition would be incorrectly formed for the altered table" /Johan Joppe A wrote: Hello all, I have a problem with a script I have made, it always stops when it trie

Re: returning results in the order they were selected

2005-04-28 Thread Johan Höök
Hi Scott, you can do: SELECT a, b, c, from table where zip IN (94949, 94945, 94947) ORDER BY FIELD(zip,94949, 94945, 94947) /Johan Scott Haneda wrote: mysql 4.0.18-standard I am running this select: SELECT a, b, c, from table where zip IN (94949, 94945, 94947) How can I get back a result set in

Re: order by "version number"

2005-04-29 Thread Johan Höök
Hi Stano, there was a response by Michael Stassen on the list about a year ago on this problem, which I hope he doesn't mind if I repeat below. /Johan Version numbers? CREATE TABLE ss (version VARCHAR(13)); INSERT INTO ss VALUES ('1'),('1.1'),(&#

Re: just hi

2005-05-11 Thread Johan Höök
Hi Ezequiel, see: http://dev.mysql.com/doc/ /Johan Ezequiel Rodriguez wrote: well im from argentina, and today i begin using mysql, i have a lot of questions, first of all, is there a mysql official manual at www.mysql.com? i have searched but don't found it :S I want to read something b

Re: Remove 1st 3 Chars

2005-05-11 Thread Johan Höök
Hi Shaun, I guess you could try something like: UPDATE table SET col = RIGHT(col, LENGTH(col) - 3 ) WHERE ... /Johan shaun thornburgh wrote: Hi, is it possible to alter fields in a column by removing the first three characters? i.e. change 100123456789 to 123456789 Thanks for your help

Re: LEFT JOIN changes order of results

2005-05-31 Thread Johan Höök
in a different order which gives you a different reslutset. I guess you somehow have to include the mls_num in your second query to ensure that you get same resultset. /Johan Scott Gifford wrote: Hello, I have an application that does searches against a database of homes. A summary of initi

Query how to??

2003-12-06 Thread Johan Driesmans
Hi, I'm having problems to make a query. Situation: One table with data: JobID,Year,Week,Place,Name 1,2003,1,Place1,Person1 2,2003,1,Place2,Person2 3,2003,2,Place1,Person3 4,2003,2,Place2,Person4 5,2003,3,Place1,Person2 6,2003,3,Place2,Person6 7,2003,3,Place3,Person5 8,2003,4,Place1,Person1 9,

Re: inser woes

2004-01-12 Thread Johan Hook
Hi Doug, I think you need to quote "imgsml=C2BUWS1028.jpg," like imgsml='C2BUWS1028.jpg', take care, /Johan [EMAIL PROTECTED] wrote: This has to be something silly, but I can not see it. Any help greatly appreciated: use newshop; insert into products set storeid=2,

Re: Newbie query question...

2004-02-04 Thread Johan Hook
Hi John, I think you missed on the precedence of AND/OR if you change to > AND (cat_id='2' OR cat_id='5' ) it should work as you want it to /Johan John Croson wrote: I have a simple query: SELECT id,year,month,day,cat_id FROM events LEFT JOIN calendar_cat ON events.cat=ca

Re: Maximum row size for MyISAM table type

2004-11-12 Thread Johan Hook
Hi Joshua, the BLOB or TEXT is stored separately from the row. What is stored is a pointer to where the BLOB/TEXT is located. /Johan Joshua Beall wrote: Hi All, I am a bit confused by the MySQL documentation on this subject. From http://dev.mysql.com/doc/mysql/en/Storage_requirements.html &quo

Re: Milliseconds to date string

2004-11-15 Thread Johan Hook
Hi Rafal, binary is a reserved word, you need to quote it with back-ticks ` if you want to use it: SELECT s2u.valus as `binary` FROM ... /Johan Rafal Kedziorski wrote: Hi, I get this: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version fo

Re: Select member when it meets two requirements

2004-11-30 Thread Johan Höök
Hi Mike, you should be able to do: SELECT DISTINCT t.member_id FROM table t INNER JOIN table t2 ON t2.member_id = t.member_id AND t2.speciality_id = 2 WHERE t.speciality_id = 6 /Johan Mike Zornek wrote: I'm very much a noob when it comes to MySQL .. Historically I've only used it for

Re: sum() Function and NULL values

2004-12-16 Thread Johan Höök
Hi Tim, I guess you can add something like this to your statement: SELECT COALESCE( SUM(column) , 0 ) FROM ... /Johan Gustafson, Tim wrote: Is there any way to make sum() return "0" instead of "NULL" when one or more of the rows being sum()'d is null? Phrased another wa

Re: Excluding Rows

2005-01-13 Thread Johan Höök
= vapall.state and fh1109.cd = vapall.cd and AND fh1109.state NOT IN ('TX','PA','ME')" /Johan [EMAIL PROTECTED] wrote: How do I exclude some rows in a table? I am merging columns from three tables all of which show all congressional districts in all states.

Re: Group Query

2004-06-22 Thread Johan Hook
Shaun, when you add "WHERE B.Project_ID > = '10'" you, in a way, change your LEFT JOIN to an INNER JOIN. You need to do it like: LEFT OUTER JOIN Bookings B ON U.User_ID = B.Rep_ID AND B.Project_ID = '8' /Johan shaun thornburgh wrote: Thanks for your reply, T

problem with tables crashing

2004-08-13 Thread Johan Jonkers
r :-( Can someone please tell me why this happened, how I can stop this from happening again as repairing the table takes a LONG time Any help would be really appreciated Regards, Johan Jonkers -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscrib

Re: problem with tables crashing

2004-08-13 Thread Johan Jonkers
V. M. Brasseur wrote: $> perror 145 Error code 145: Error 145 occurred. 145 = Table was marked as crashed and should be repaired I think `myisamchk` needs to come into play here (both on slave and master at this point). Yea I know, and I had done that like a few days ago because it gave me the s

Re: Select non-matching rows

2004-08-20 Thread Johan Hook
Hi, you could try: SELECT tbl1.id FROM tbl1 LEFT JOIN tbl2 ON tbl2.another_id = tbl1.id WHERE tbl2.id IS NULL /Johan Manish wrote: This should be simple but I am stuck here. I need to select rows from table 1, which do not have matching ID in table 2. Say each table has 100 rows each, and 90 rows

Re: "PRODUCT()" function - calculating the product of grouped numeric values

2004-08-31 Thread Johan Hook
Hi, you might take a look at this thread: http://lists.mysql.com/mysql/166184 /Johan Hi, I'm searching for a function that enables me to calculate the product of a group of values, like SUM() does. MySQL server version is at least 4.0.14. For example, a query like "SELECT id, PRODUCT

Re: Select with normalized table

2004-09-21 Thread Johan Pettersson
others) you could use: SELECT strategyid, COUNT(marketid) cnt FROMstrategies_markets WHERE marketid in() GROUP BY strategyid HAVING cnt = If you reverse the key-order in the primary key of strategies_markets, this baby should really fly. Regards, Johan 2004-09-21 kl. 11.51 skrev Philippe

MySQL Query Help Needed

2003-09-17 Thread Johan Potgieter
0917134245 | ++-+-+--+--++ As you can see this is not correct. I want "job" to be grouped together with it's highest bid amount. The following should be listed by relevance and bid. Can anyone help refine this search, please Johan Potgieter

Re: Newbie: Rewriting A Query- How?

2004-03-09 Thread Johan Hook
s.PROJECTSTATUS <> 'Potential' Hope this helps, /Johan Ken Brown wrote: Anyone any idea how I could rewrite this as a join - all the indexes are in place and each of the components of this work fine - its only when the combined subqueries are passed to the root query does it ap

  1   2   3   4   5   6   7   8   9   10   >