Adding values returned by GREATEST

2016-05-03 Thread Sukhjinder K. Narula
Hello, i have a question regarding the GREATEST function of mysql. I would like to add the values returned by GREATEST function is mysql, so a query is like below: For example table t has 6 fields with values as follows: A = 1, B = 3, C=0, D = 0, E = 1 and F = 0 and I run a query: SELECT GREATE

Re: Performance boost by splitting up large table?

2014-05-14 Thread Sukhjinder K. Narula
Hi, You could split the table into two and can avoid code changes by creating a view which matches what code is looking for. I think loading few fields vs 254 into memory will make a difference but if your select statement only have specific fields you want and not the whole row (and also given t

Re: Decode Json in MySQL query

2014-03-21 Thread Sukhjinder K. Narula
gt; > Hi, you probably want to perform this conversion on your client. There > are JSON parser libraries available for Java, PHP and the like. Cheers, > Karr > > > > On Mar 20, 2014, at 11:35 AM, Sukhjinder K. Narula > wrote: > > > >> Hello, > >>

Decode Json in MySQL query

2014-03-20 Thread Sukhjinder K. Narula
Hello, I would like to know if there is a way to decode the json string stored in one of the fields as text without using triggers or stored procedures. What I want to do is is within the query, I would like to get one row per element within the json string. For example: the json string is as follo

Re: a Java-connector

2013-12-11 Thread Sukhjinder K. Narula
Its called JDBC connector, please see the link: http://dev.mysql.com/doc/connector-j/en/connector-j-usagenotes-connect-drivermanager.html good luck. On Wed, Dec 11, 2013 at 10:15 AM, wrote: > I have MySQL 5.5.8 under Windows Vista, and I am minded to write Java > programs to talk to the serve

Re: Check for numeric values

2013-10-08 Thread Sukhjinder K. Narula
Hi, You could use regular expression to do this, here is the example with the reference site that might help you: If your data is 'test', 'test0', 'test', '111test', '111' SELECT * FROM myTable WHERE col1 REGEXP '^[0-9]+$'; Result: '111' In regex ^ mean begin, and $ - end. SELECT * FROM m

Re: Problem with having

2013-09-23 Thread Sukhjinder K. Narula
Hi, In your second query, you seem to have MIN(date_time), but you are talking about maximum. So your group by query is actually pulling the minimum date for this recipe. Regards. On Mon, Sep 23, 2013 at 3:35 PM, Larry Martell wrote: > I want to find the rows from a table that have the max date

Question regarding creating a query

2013-07-30 Thread Sukhjinder K. Narula
Hello, I have a question regarding creating a query as follows: 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.