Re: mysql Digest 12 Aug 2015 13:08:20 -0000 Issue 5317

2015-08-12 Thread hsv
On 2015/08/12 10:49, Bob Eby wrote: converting from MyISAM to innodb would certainly pose problems, I guess the main question would be is MyISAM functionality a strict sub-set of innodb? I'm not sure, but maybe someone else here knows better. No, as already said: for one thing, MyISAM allows

Re: table desin question

2015-08-12 Thread hsv
On 2015/08/12 09:42, Johan De Meersman wrote: - Original Message - From: Richard Reinagatorre...@gmail.com Subject: table desin question Would this be the best way to design the schema and would it be best to make the client ID and technician ID the same as the user ID as they relate

Re: To:, CC: mailing lists

2015-05-17 Thread hsv
On 2015/05/17 14:10, Jigal van Hemert wrote: I've set filters on To: or Cc: contains to catch all the mails. The others in this thread use Gmail which obviously lacks a button Reply to list. One does not need such a button, only attention to the addressee list that one s e-mail client produces.

Re: Why does a group_concat on a join change aggregate values?

2015-05-09 Thread hsv
On 2015/05/07 19:42, Paul Halliday wrote: Should have showed the whole thing. Take a look here (click image to see full output): http://www.pintumbler.org/tmp I don't see why this worries you. Joining often increases variation. Indeed, if in some case an inner join never did, maybe the

Re: time stamp specific to columns

2015-04-14 Thread hsv
On 2015/04/09 13:42, Michael Dykman wrote: A trigger is far simpler than remodelling your data and adding extra queries. They are nothing to be afraid of. Not afraid of, but to be careful when writing. I have had trouble with my triggers, because I left thisthat out. As for timestamping,

Re: Issue with timestamp columns while working with MySQL load data in file

2015-04-13 Thread hsv
On 2015/04/12 08:52, Pothanaboyina Trimurthy wrote: The problem is , as mentioned the load data is taking around 2 hours, I have 2 timestamp columns for one column I am passing the input through load data, and for the column DB_MODIFIED_DATETIME no input is provided, At the end of the load data

Re: time stamp specific to columns

2015-04-09 Thread hsv
On 2015/04/08 11:42, Andrew Wallace wrote: I think you'd have to do that with a trigger. Yes, one can do that with a trigger, but it is a real pain. MySQL now allows (new.a,new.b,new.c,new.d) (old.a,old.b,old.c,old.d) but one needs to beware of NULL. Maybe it is better to split off

Re: Dumping database names from bash with exclusion

2015-04-01 Thread hsv
On 2015/04/01 16:09, Tim Johnson wrote: Using Mysql 5 on darwin (OS x). This command SELECT schema_name FROM information_schema.schemata WHERE schema_name NOT IN ('mysql','information_schema','performance_schema'); as executed from the mysql prompt gives me a dump of all databases except those

Java-connector missing connector class

2014-12-20 Thread hsv
Ignore my earlier question: my problem arose from not feeding Eclipse the right CLASSPATH when my new program was main. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Java-connector missing connector class

2014-12-19 Thread hsv
I wrote a Java program to send a query s output to standard output. I later wrote another to call the former whithersoever I wish to send its output. The query program just as I would like works--but when subordinated to the newer program the connector class (com.mysql.jdbc.Driver) referred to

Re: command is not allowed with this MySQL version

2014-12-12 Thread hsv
2014/12/12 02:10 +0100, Christophe When the app tries to do this, it raises an error : 'The used command is not allowed with this MySQL version' The used MySQL version is 5.5.40 from Debian Wheezy package. I found that some parameters or variables (local_infile for instance) can be used to

Re: forum vs email

2014-12-10 Thread hsv
2014/12/10 09:00 +0100, Johan De Meersman One of the (for me, at least) defining features of a forum, is that the subjects tend to be divided up into a tree structure, which has it's own benefits Something more sophisticated than grouping messages by trimmed subject-lines? maybe

Re: forum vs email

2014-12-09 Thread hsv
2014/12/09 15:20 -0600, Peter Brawley Nope. And why not? Because no one bothered to implement it? Now I (for the first time?) looked at forums.mysql.com and see more topics than on lists.mysql.com. The former is just more with-it, I guess. I believ that one could both by e-mail and through a

Re: update and control flow

2014-12-09 Thread hsv
2014/12/09 14:25 +, Martin Mueller I'm trying to get my feet wet with 'if' and 'when' uses in mysql. it would be very useful for update operations, but I can't get it right. If I read the documentation correctly, it should be possible to say something like UPDATE X if WORD like 'a%' SET

Re: forum vs email

2014-12-06 Thread hsv
2014/12/06 12:51 +0100, Johan De Meersman I want: * The entire post, and as little notification-type content as possible, * headers and subjects so that mail clients that support threading will thread everything from a single forum topic in a mail thread and vice versa, * and, most

Re: forum vs email [was: Re: table-for-column]

2014-12-05 Thread hsv
2014/12/04 22:56 -0500, shawn l.green I guess this email-based peer-to-peer exchange is slowly disappearing into the background like the old usenet newsgroups, eh? And _I_ like using an off-line e-mail client, and not being bothered by going through a webbrowser--but I suspect that others

Re: MySQL dying?

2014-11-26 Thread hsv
2014/11/26 14:25 -0600, Peter Brawley www.artfulsoftware.com/infotree/mysqltips.php, And this page is an HTML hack, table for column ... generated by a (PHP?) program? *sigh* -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: Using INTEGER instead of VARCHAR/DATE - is this a way to faster access?

2014-10-30 Thread hsv
2014/10/29 20:56 +0100, Zbigniew Now to the point: considering, that the second column shall contain about 100-200 different labels - so in average many of such labels can be repeated one million times (or even more) - will it speed-up the selection done with something like ...WHERE label='xyz'

Re: Query with variable number of columns?

2014-10-08 Thread hsv
2014/10/08 11:38 -0700, Jan Steinman However, this pattern will often result in numerous empty columns -- empties that would not be there had the table not been pivoted. 2014/10/08 16:42 -0500, Peter Brawley MySQL stored procedures are less incomplete, and can do it, but they're awkward.

RE: converting numeric to date-time?

2014-09-06 Thread hsv
2014/09/04 08:40 -0700, Jan Steinman From: Ed Mierzwa (emierzwa) emier...@micron.com FROM_UNIXTIME(1409304102.153) /*your epoch column here*/ I don't think the OP has a Unix timestamp. The number looks suspeciously like concatenation of date digits, 140930 at the beginning looks like

Re: ERROR in syntax...

2014-09-06 Thread hsv
2014/09/06 09:06 -0700, Don Wieland Can anyone tell me why this query is generating an ERROR: Which error? The first IF statement is not properly ended? it isn't. (A series of equality tests against the same variable is done more conveniently with CASE ... END CASE.) -- MySQL General

Re: Excluding MySQL database tables from mysqldump

2014-04-08 Thread hsv
2014/04/07 08:02 -0800, Tim Johnson 2)mysqldump forces all database names to lower case in the CREATE DATABASE statement. I know, one shouldn't use upper case in database names, but :) tell that to my clients. Why not? That is not mentioned in the section devoted to mapping such names to

Re: Conditional in update

2014-02-12 Thread hsv
2014/02/11 18:14 -0500, Larry Martell set LIMIT = sign(LIMIT) * 100 * floor(0.01 + (sign(LIMIT) * LIMIT * ratio/100) The function TRUNCATE can be useful here: set LIMIT = TRUNCATE(LIMIT * ratio + 0.01 * sign(LIMIT), -2) , if it works as advertized. In any case, ABS(LIMIT) = sign(LIMIT)

link-bug

2014-01-30 Thread hsv
2014/01/29 16:16 -0800, neubyr https://dev.mysql.com/doc/refman/5.0/en/replication-features-load.html - Someone was not all awake when making this webpage up: four of the links under Table of Contents point to this same page. (I was looking because I was thinking about Neubyr s problem, but I

Re: grouping by the difference between values in rows

2014-01-21 Thread hsv
2014/01/12 14:17 -0500, Larry Martell I've been asked to do something that I do not think is possible in SQL. I have a query that has this basic form: SELECT a, b, c, d, AVG(e), STD(e), CONCAT(x, ',', y) as f FROM t GROUP BY a, b, c, d, f x and y are numbers (378.18, 2213.797 or 378.218,

cp850??

2014-01-21 Thread hsv
I like Latin1. I set up my version 5.5 to use it by default, but sometimes it changed Client Connection characterset to UTF8. Now I have 5.6, and the client comes up with Client Connection characterset CP850 (CP850 is the Swedish variant of CP437, the IBM PC s original character set). Why???

Re: Foreign-key reference

2014-01-07 Thread hsv
2014/01/06 14:24 -0500, Morgan Tocker You might be hitting: Important The inline REFERENCES specifications where the references are defined as part of the column specification are silently ignored. MySQL only accepts REFERENCES clauses defined as part of a separate FOREIGN KEY specification.

Re: ERROR 2013 (HY000): Lost connection to MySQL server during query

2014-01-07 Thread hsv
2014/01/06 17:07 +0100, Reindl Harald what about look in the servers logfiles most likely max_allowed_packet laughable low Is this then, too, likly when the server and the client are the same machine? I left this out, that it only then happens when the client has been idle, and right

Re: loading 0x00A0 into mysql

2014-01-06 Thread hsv
2014/01/06 12:18 +, Dave Howorth Everything appears to work except that text fields containing a Unicode non-breaking space (0x00A0) are truncated just before that character. I can see the field in the dump file and it looks OK, but it doesn't all make it into the new database. Well, there

ERROR 2013 (HY000): Lost connection to MySQL server during query

2014-01-06 Thread hsv
Now that I installed 5.6.14 on our Vista machine, when using mysql I often see that error-message, which under 5.5.8 I never saw. What is going on? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Foreign-key reference

2014-01-06 Thread hsv
Are INNODB foreign-key references ignored in 5.6? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: Really slow batch insert??

2013-12-30 Thread hsv
2013/12/30 13:59 +0200, Cabbar Duzayak We have a basic table, which is something like : (id varchar50, productId varchar50, category varchar50) In this table, ID is the primary key and we have a unique index on (category, productId). And, there is a case where we want to do bulk inserts

Re: LOAD DATA INFILE with space after quote but before comma

2013-12-19 Thread hsv
2013/12/18 11:07 -0500, Anthony Ball I ran across a curious issue, I'd call it a bug but I'm sure others would call it a feature. I have a csv file with space between the and , and it causes MySQL to eat that field and the field after it as a single field. Is there a setting I can use to

a Java-connector

2013-12-11 Thread hsv
I have MySQL 5.5.8 under Windows Vista, and I am minded to write Java programs to talk to the server. I believe that a connecter is needed for that, something with ODBC in the name--which version is best for my use? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

Re: Another query question...

2013-11-12 Thread hsv
2013/11/08 17:35 -0800, Jan Steinman Okay, I think I found it: http://bugs.mysql.com/bug.php?id=47713 I added a comment with a link to a page I set up to show the behaviour on my system. http://www.ecoreality.org/wiki/WITH_ROLLUP_problem It was submitted in 2009, severity

Re: Another query question...

2013-11-04 Thread hsv
2013/11/04 09:32 -0800, Jan Steinman I noticed that I have similar queries that work as expected. The difference appears to be that every query that is broken uses WITH ROLLUP, and removing this makes them behave as expected. Is this a known bug? Should I submit it as such? If someone would

Re: Update Column in table only if variable is Not NULL

2013-10-29 Thread hsv
2013/10/28 21:23 +, Neil Tompkins Basically the snippet of the UPDATE statement I provided shows updating only 1 field. However in my live working example, I have about 20 possible fields that might need to be updated if the variable passed for each field is NOT NULL. Well, maybe

Re: Update Column in table only if variable is Not NULL

2013-10-29 Thread hsv
2013/10/29 11:35 -0400, Shawn Green My favorite technique is the COALESCE function for this on a column-by-column basis SET FieldName1 = Now(), FieldName2 = COALESCE(:MyVariable, FieldName2) but if MyVariable is NULL, FieldName1 reflects the attempt to change, not change. -- MySQL

RE: Change to MySQL Community Server 5.7.2?

2013-10-28 Thread hsv
2013/10/25 00:08 +, Rick James There's an old saying, If it ain't broke, don't fix it. Why _might_ 5.6.x or 5.7.x be better for you? Sure there might be some features you might want, might be some performance improvements that you might notice, etc. And there might be some regressions

Re: MySQL Community Server 5.7.2 has been released (part 1)

2013-10-24 Thread hsv
MySQL fans, 2013/09/21 18:04 +0200, Bjorn Munch MySQL Server 5.7.2 (Milestone Release) is a new version of the world's most popular open source database. This is the second public milestone release of MySQL 5.7. Is this a good replacement for that 5.5.8 that I long ago downloaded and

Re: Date comparison help

2013-10-22 Thread hsv
2013/10/22 12:20 -0400, I recently upgraded a local MySQL installation to 5.5.32 and am trying to figure out why the following query won't work as expected anymore. I'm just trying to compare a set of dates to NOW() but since the upgrade, these don't seem to work as expected. SELECT

Re: Can't Connect Localhost

2013-09-03 Thread hsv
2013/09/02 12:49 +0800, John Smith I looked in mysql.config.pl and no localhost :( mysql.config.pl from what software damned? mysql.config.pl does not exist in context of mysql It exists in the following folder on my Win8 box: /Program Files (x86)/MySQL/MySQL Server 5.5/bin Yes,

Re: Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-22 Thread hsv
2013/08/22 14:22 -0400, Nick Cameo SimpleDateFormat sdf = new SimpleDateFormat(-MM-dd'T'HH:mm:ss, new Locale(en, US)); Well, you have your answer (FROM_UNIXTIME( /1000)), but that stupid ISO format with 'T' in the middle does not work, because to MySQL letters are not

Re: Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-21 Thread hsv
2013/08/21 18:03 -0400, Nick Khamis We have the following mysql timetampe field startdate | timestamp | NO | | -00-00 00:00:00 When trying to insert a long value in there: Calendar c = Calendar.getInstance(TimeZone.getTimeZone(UTC)); c.getTimeInMillis(); We are presented with the

Re: Question regarding creating a query

2013-07-30 Thread hsv
2013/07/30 14:12 -0400, Sukhjinder K. Narula I have several databases (all with same structure), which I to query. For instansce: db1, db2, db3 - all have table tb1 with field a, b and table tb2 with fields flag1, flag2 So I want to query and get field a from tb for all db's. One way to do is

Re: hypothetical question about data storage

2013-07-26 Thread hsv
2013/07/27 00:58 +0200, Chris Knipe I would definately consider the md5 checksum as a PK (char(32) due to the hex nature), Well, not that it greatly matters, but you could convert it to BINARY(16). -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: Get Affected Rows after Stored Procedure COMMIT

2013-07-02 Thread hsv
2013/07/02 12:29 +0100, Neil Tompkins I have a number of INSERT and UPDATE statements in a MySQL Stored Procedure, that works in the form of START TRANSACTION followed by COMMIT. Also I am handling any EXCEPTION. However, after calling COMMIT, how can I get the number of Rows that were

Re: space gone after MyISAM REPAIR TABLE

2013-06-26 Thread hsv
2013/06/26 17:31 +0100, nixofortune ALTER TABLE `new_innodb` ADD KEY `idx1` (`col1`,`col2`), ADD KEY `idx2` (`col1`,`col2`,`col3`); Is it really seemly for one index to be a leading part of another? (or maybe I am really thinking of something else) -- MySQL General Mailing List For list

RE: How do I select all rows of table that have some rows in another table (AND, not OR)

2013-06-18 Thread hsv
2013/06/13 23:08 +, Rick James FIND_IN_SET might work the cleanest... WHERE FIND_IN_SET('action', genres) OR/AND [NOT] ... And have genres look like 'action,drama,foobar', that is comma-separators, and no need for leading/trailing comma. That would also work for genres = '1,3,10,19,38' and

Re: Update just some of the fields

2013-06-17 Thread hsv
2013/06/17 11:38 +0430, Sayyed Mohammad Emami Razavi update test set desc='test10' where id=1; _That_ is UPDATE! It is the only means of changing, but neither inserting nor deleting, a record. The other fields are left the same. MySQL also tracks whether it is an actual change; this is

Re: How do I select all rows of table that have some rows in another table (AND, not OR)

2013-06-13 Thread hsv
2013/06/11 12:59 -0700, Daevid Vincent Also, just for SG this is how we are currently implementing it, but we feel the REGEXP is killing our queries and while clever is a bit hacky and nullifies any indexes we have on the genres column as it requires a file_sort table scan to compare substrings

Re: How do I select all rows of table that have some rows in another table (AND, not OR)

2013-06-13 Thread hsv
2013/06/11 12:59 -0700, Daevid Vincent Also, just for SG this is how we are currently implementing it, but we feel the REGEXP is killing our queries and while clever is a bit hacky and nullifies any indexes we have on the genres column as it requires a file_sort table scan to compare substrings

RE: string-likeness

2013-06-06 Thread hsv
2013/06/03 21:43 +, Rick James Soundex is the 'right' approach, but it needs improvement. So, find an improvement, then do something like this... Hashing involves somekind normalizing, and in my case I see no means to it; otherwise I would not have considered something so costly. On the

Re: Stopping mysql does not always stop it?

2013-06-06 Thread hsv
2013/06/06 09:28 -0400, Mike Franon Long story short, 50% of the time the command /etc/init.d/mysqld stop will fail Don't see why it anywhen succeeds. My version of mysqld doesn't know stop. As for mysqladmin, it knows stop, but, since that means stop-slave, I doubt you want that. Maybe you

Re: string-likeness

2013-06-04 Thread hsv
2013/06/03 18:38 +0200, Hartmut Holzgraefe equality checks have a linear cost of O(min(len1,len2)) and can make use of indexes, too, while Levenshtein cost is is almost quadratic O(len1*len2) and can't make any good use of indexes ... even using a C UDF would help only so far with this kind of

string-likeness

2013-06-03 Thread hsv
I wish to join two tables on likeness, not equality, of character strings. Soundex does not work. I am using the Levenstein edit distance, written in SQL, a very costly test, and I am in no position to write it in C and link it to MySQL--and joining on equality takes a fraction of a second, and

Re: Editing existing Trigger MySQL 5.6

2013-05-29 Thread hsv
2013/05/29 10:39 +0100, Neil Tompkins Using Workbench with MySQL 5.6 how do I edit a existing Trigger. Do I need to DROP the Trigger and create a new one ? If that is the case how can you run start command in a live environment ? Whatever appearance Workbench adds (I do not know it),

Re: Temporary Tables with Triggers Problem

2013-05-29 Thread hsv
2013/05/29 14:51 +0100, Neil Tompkins This is my Trigger which doesn't seem to work; but doesn't cause a error DROP TEMPORARY TABLE IF EXISTS tempHotelRateAvailability; CREATE TEMPORARY TABLE tempHotelRateAvailability(AuditTrailId varchar(36),UserId bigint(20),ActionType

Re: Bug in BETWEEN same DATETIME

2013-05-24 Thread hsv
2013/05/24 09:49 -0400, shawn green Or we could coerce datetime values back to their date values when both are being used. The trick now becomes choosing between rounding the datetime value (times past noon round to the next date) or do we use the floor() function all the time. This is

RE: Version 5.6.2-m5 Boolean Datatype

2013-05-22 Thread hsv
2013/05/22 21:17 +, Rick James In query syntax, TRUE is the same as 1; FALSE is the same as 0. and UNKNOWN is NULL. (I actually have used a three-state comparison.) It has been suggested that one who wants a real two-state field use the type CHAR(0) NULL. If you have more 'flags',

Re: NET START MYSQL QUESTION?

2013-05-11 Thread hsv
2013/05/11 20:50 +0600, SIVASUTHAN NADARAJAH I want to start the mysql from command prompt using NET START MYSQLBUT the server not started. It display an error message. C:\Users\PC NET START MySQLSystem error 5 has occurred. Access is denied. could you please help me, how to start the

Re: NET START MYSQL QUESTION?

2013-05-11 Thread hsv
2013/05/11 22:58 +0200, Reindl Harald why not answer the question another user made hours ago? under which account do you try to start mysqld? Well, I learnt something here. When I had the problem of (under Vista) starting mysqld, from command prompt I always did this, start mysqld -b...

Re: Long integer constant problem in views

2013-04-30 Thread hsv
2013/04/30 17:17 +0200, Martin Koch CREATE OR REPLACE VIEW foo AS SELECT * FROM mytable WHERE id = X'36a461c81cab40169791f49ad65a3728'; Try this: _binary X'36a461c81cab40169791f49ad65a3728' SHOW CREATE VIEW is the command for the client. -- MySQL General Mailing List For list

Re: how to list record in column (instead of a row)

2013-04-24 Thread hsv
2013/04/24 09:06 -0700, Rajeev Prasad this table has many columns and only 1 record. select * from table; generates an unreadable list. how can i list the record as in two columns? (column name and its value)? i looked at UNPIVOT, but could not get it to work. SQL select * from table UNPIVOTE

Re: Doubt with stored procedures

2013-04-17 Thread hsv
2013/04/17 14:16 +0200, Antonio Fernández Pérez I have a doubt with stored procedures functionality. Is possible that a stored procedure works with all databases form the server? I have created a stored procedure on dataBaseA and also works with dataBaseB. Is that correct? Independently of the

Re: error-log aging

2013-04-15 Thread hsv
2013/04/05 11:16 +0200, Johan De Meersman Half and half - rename the file, then issue flush logs in mysql to close and reopen the logs, which will cause a new log with the configured name to be created. That being said, I'm not much aware of Windows' idiosyncracies - I hope the damn thing

Re: update a row only if any column has changed, in a very large table

2013-04-06 Thread hsv
2013/04/06 13:56 -0700, Rajeev Prasad I have a table with around 2,000,000 records (15 columns). I have to sync this from an outside source once every day. not all records are changed/removed /new-added everyday. so what is the best way to update only those which have changed/added/or

error-log aging

2013-04-04 Thread hsv
Is there somewhere within MySQL means of aging the error log, that it not indefinitly grow big, or is that done through the OS and filesystem on which mysqld runs? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: Determing number of queries

2013-04-04 Thread hsv
2013/04/04 22:40 +0200, Manuel Arostegui You can start with show innodb status; It is now show engine innodb status -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: error-log aging

2013-04-04 Thread hsv
2013/04/04 23:18 +0200, Reindl Harald Is there somewhere within MySQL means of aging the error log, that it not indefinitly grow big, or is that done through the OS and filesystem on which mysqld runs? man logrotate Not Unix! In any case, I take this to mean that this is not done within

Re: Show ROUTINE body, not PROCEDURE

2013-03-27 Thread hsv
2013/03/27 08:01 +0200, Dotan Cohen Actually, it is the user that I am logged in as that created the function. That is why I find it hard to believe that one needs root / admin access to see its definition. And that user set DEFINER other than itself, and that worked??? That takes SUPER. --

Re: Show ROUTINE body, not PROCEDURE

2013-03-25 Thread hsv
2013/03/25 11:28 +0200, Dotan Cohen Thanks. I don't have the admin or root privileges on this database. Is that the only way to see the code behind the function? Well, you showed us DEFINER: admin@localhost for the function; here is a snippet from MySQL help about SHOW CREATE FUNCTION

Re: a little doubt on text about MySQL

2013-03-17 Thread hsv
2013/03/16 03:44 +0100, Reindl Harald what are you speaking about? you can define it in my.cnf and YOU are responsible for the configuration as you are also responsible the develop php code with error_reporting = E_ALL These SQL-modes that pertain to type-safety are really part of the _type_:

Re: a little doubt on text about MySQL

2013-03-16 Thread hsv
2013/03/15 12:43 -0300, Marcus Vinicius Does anyone knows the author of this: http://grimoire.ca/mysql/choose-something-else Title: Do Not Pass This Way Again Not I --but, as to automatic type-conversion, I find me in agreement with the author. When I first began to use MySQL I was dismayed

Re: Retrieve most recent of multiple rows

2013-03-15 Thread hsv
2013/03/13 13:18 +, Norah Jones I have a table which looks like this: answer_id q_id answer qscore_id answer_timestamp 1 10Male3 1363091016 2 10Male3 1363091017 3 11Male3 1363091018 4

IF and CASE

2013-02-05 Thread hsv
It is my impression that when their functions are equivalent, IF takes more time than CASE. Comment? Do they always evaluate all their arguments? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

RE: IF and CASE

2013-02-05 Thread hsv
2013/02/05 17:06 +, Rick James As a Rule of Thumb, function evaluation time is not significant to the overall time for running a query. (I see IF and CASE as 'functions' for this discussion.) Do you have evidence that says that IF is slower? Perhaps using BENCHMARK()? Not BENCHMARK: I

Re: Complex MySQL Select Statement Help

2013-02-03 Thread hsv
2013/02/02 12:58 -0600, Peter Brawley On 2013-02-01 10:18 PM, h...@tbbs.net wrote: 2013/01/31 22:24 -0600, Peter Brawley Is this what you mean? Select, pricelist If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between startingDate And endingDate, specialprice, unitprice )

Re: Complex MySQL Select Statement Help

2013-02-02 Thread hsv
2013/01/31 22:24 -0600, Peter Brawley Is this what you mean? Select, pricelist If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between startingDate And endingDate, specialprice, unitprice ) as used_price From catalog Where itemid='WB314'; PB Maybe this is gilding the

Re: Foreign-key naming

2012-12-12 Thread hsv
When I wrote my comment after Larry Martell s problem, I already suspected it was somewhat out of place because to his problem it did not apply. 2012/12/12 08:25 -0500, Shawn Green This is a perfectly acceptable naming convention to use. For example if you have a field on the `art` table that

Re: Help with left outer join

2012-12-11 Thread hsv
2012/12/11 16:19 -0500, Larry Martell I have this query: SELECT data_target.name, ep, wafer_id, lot_id, date_time, data_file_id, data_cstimage.name, bottom, wf_file_path_id, data_measparams.name, vacc, data_category.name FROM data_cst, data_target, data_cstimage,

CONCAT_WS and NULL

2012-12-11 Thread hsv
This is, maybe, a question of taste. I find it useful in the aggregate functions that they ignore all NULLs that come under their purview, but yield NULL if nothing else comes. Now, CONCAT_WS is no aggregate function, but is like them in that it ignores all NULLs that come its way, aside from

Re: MUltiple value in single insert is not working in mysql procedure

2012-12-05 Thread hsv
2012/12/03 19:10 +0530, amit Problem mysql call mobile_series1('(99889988),(12334565)'); You are expecting MySQL to turn one string operand into twain number operands. That does not happen, unless you use PREPARE, which, I suspect, is not part of your homework. -- MySQL General Mailing

Re: MySQL dying?

2012-12-04 Thread hsv
2012/12/04 15:18 -0800, Karen Abgarian MySQL, like all other products, can be peachy or bitchy. Good ones, they also die.Wish I was kidding :-) Mind VHS BetaMax? BetaMax had much better color--but VHS long outlasted it. -- MySQL General Mailing List For list archives:

Re: Retrieve the values from the table of its max date

2012-11-30 Thread hsv
2012/11/29 11:46 +0530, Trimurthy i have a table which contains the columns date,sname,age,item,quantity,units.my question is i want to retrieve all the values from the table where date=maxdate group by sname how can i get those values. A question, I suspect, found in all SQL courses

Re: Stored Procedure Question?

2012-11-23 Thread hsv
2012/11/23 10:49 +0530, Girish Talluru I have a scenario where I have to screen a huge bunch of records for in db using certain rules. I have done in traditional php style record by record and it took 90 mins for 4000 records. I have 800k - 900k records in production which might possibly lead to

Re: Basic SELECT help

2012-11-22 Thread hsv
2012/11/22 14:30 +, Neil Tompkins I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 From this I what to get a distinct list of id where the type equals 2 and 5 Any ideas ? This ugly one,

Re: Basic SELECT help

2012-11-22 Thread hsv
2012/11/22 14:30 +, Neil Tompkins I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 From this I what to get a distinct list of id where the type equals 2 and 5 Any ideas ? This ugly one,

Re: Dynamic crosstab got me lost.

2012-11-20 Thread hsv
2012/11/19 05:05 +0100, Mogens Melander I found an article on: http://stackoverflow.com/questions/3122424/dynamic-mysql-query-view-for-crosstab Describing how to do the dynamic generation of SQL statements. And I was inspired to do some such thing to one of my views. This view has three

Re: Dynamic crosstab got me lost.

2012-11-19 Thread hsv
2012/11/19 04:49 -0800, Jan Steinman SELECT main.code , IF(iconstandardrel.icon = 4,1,0) AS 'internationalt_produkt.eps' , IF(iconstandardrel.icon = 3,1,0) AS 'god_vaerdi.eps' , IF(iconstandardrel.icon = 2,1,0) AS 'for_miljoeets_skyld.eps' , IF(iconstandardrel.icon = 1,1,0) AS

Re: Issue regarding the import of the date from csv file to the table in the database in mysql

2012-11-15 Thread hsv
2012/11/15 00:30 +0100, Mogens Melander I guess I'm sill learning. Does that mean that, if the last column in a load blabla. is a -00-00 terminated by ^n it might error ? Or are we talking ODBC ? Find it under LOAD DATA If an empty field is parsed for a NOT NULL DATE or DATETIME,

Re: Issue regarding the import of the date from csv file to the table in the database in mysql

2012-11-14 Thread hsv
2012/11/14 10:26 +0530, sagar bs As i have the data with some 25 variables in csv file and i need to import to mysql. The issue is that the date format in csv file is dd/mm/ and mysql takes the date format like /mm/dd. The number of variables in the csv file are same in the table in

Re: Issue regarding the import of the date from csv file to the table in the database in mysql

2012-11-14 Thread hsv
2012/11/14 18:27 +0530, sagar bs There are four columns in my table named like account_name, c1, c2 and c3. Account name is the primary key and c1, c2 contain two different dates and in the column c2 there are few fields showing /00/00, now i need to get the date different(in days)

Re: UDF behaves non-deterministic

2012-11-05 Thread hsv
2012/11/04 22:23 +, Stefan Kuhn select * from table order by udf(column, 'input_value') desc; For my understanding, this should give the same result always. But if for your data function udf returns the same for more arguments there is not enough to fix the order. In that case I have

Re: mysql logs query with indexes used to the slow-log and not logging if there is index in reverse order

2012-10-16 Thread hsv
2012/10/16 12:57 -0400, Michael Dykman your now() statement is getting executed for every row on the select. try ptting the phrase up front as in: set @ut= unix_timestamp(now()) and then use that in your statement. Quote: Functions that return the current date or time each are evaluated only

Re: Extract text from string

2012-10-13 Thread hsv
2012/10/12 17:56 +0100, Neil Tompkins Is there such a way in a MySQL query to extract the text this is a test from the following strings as a example stronga href=http://www.domain.com/; class=linkthis is a test/a/strong stronga href=http://www.domain.com/; title=this is a test

Re: column aliases in query

2012-10-11 Thread hsv
2012/10/11 13:46 -0400, Mark Haney I know it's been a while since I wrote serious queries, but I'm sure I have done something like this before: SELECT SUBSTR(date,1,10) as vDate, event_id, events.mach_id, machine.factory_id FROM events JOIN machine ON events.mach_id = machine.mach_id WHERE

RE: date-IFNULL-sum bug?

2012-10-09 Thread hsv
2012/10/08 14:52 -0700, Rick James Do not use + for DATE arithmetic! Use, for example + INTERVAL 1 YEAR No, those operations are well defined. Amongst the timestamp-functions there is constant reference to numeric context, and character context--and well there is, because there are no

date-IFNULL-sum bug?

2012-10-05 Thread hsv
Can anyone explain this to me? The first one seems quite wrong; the rest make perfect sense. mysql select ifnull(date('1900/5/3'), date('1900/01/01')) + 1; +--+ | ifnull(date('1900/5/3'), date('1900/01/01')) + 1 |

Re: (real) silly question about variables...

2012-10-05 Thread hsv
For this, 2012/10/04 16:13 +0200, MAS! IF(GROUP_CONCAT(DISTINCT secA.sec_code SEPARATOR '|') is null, IF(GROUP_CONCAT(DISTINCT secB.sec_code SEPARATOR '|') is null,

  1   2   >