mysql

is there a format for time only in mysql

is there a format for time only in mysql ...

mysql aggregate multiple columns by hour.

Hi all, Had a quick look through and couldn't find my question again. So I'm hoping someone here can help. I have a large table with a similar structure to the below. DateTime | InboundUserID | OutboundUserID | CustomerUserID | Cost | Mins | Account Number I'm trying to group the above data into hourly chunks and store the result in a...

How to take dump of serverdb in mysql

Hi folks, I have database on the server but as a developer when we found some bug in the product then to resolved that bug quickly we need to take dump of database which is currently present on the server.As the db size is much larger so it is not possible everyday to create dump and download it which is wasting some times.So I w...

How to get how many hour minute seconds laps on message on php mysql?

How to get how many hour minute seconds laps on message on php mysql? like 23 seconds ago 1 minute ago is this possible? ...

Problems in inserting utf-8 string into database and then outputting it to web page.

I am learning PHP programming, so I have setup testing database and try to do various things with it. So situation is like that: Database collation is utf8_general_ci. There is table "books" created by query create table books ( isbn char(13) not null primary key, author char(50), title char(100), price float(4,2) ); Then ...

using mysql server community vs apache

i implemented an internal intranet system recently that uses mysql as a dbms and python as the main programming language . i was thinking about deploying it over apache , but my fried came to me this morning and advised me to use MySQL server community. this system will be handling the assets of a maximum 500 user daily ( we are talki...

error while inserting symbol in database with JPA

I am using JPA to insert into Mysql database and it is not able to persist symbols like double quotes(") or euro etc. instead of that it persist Que mark (?) ...

executemany problem, MySQLdb

I'm using MySQLdb and run into the following problem: STMT="""INSERT INTO test_table VALUES (%s, %s, %s, %s, %s)""" rows=[('Wed Apr 14 14:00:00 2010', 23L, -2.3, 4.41, 0.83923)] conn.cursor().executemay(STMT, rows) results in: Traceback (most recent call last): File "run.py", line 122, in <module> File "C:\Python25\lib\site-pack...

tinymce: apostrophes in editor, faulty mysql post

apostrophes in tinymce editor breaks the mysql query, how do I fix this? ...

Get the last entries using GROUP BY

I'm having problem with GROUP BY. It returns the first entry it could find, but I would like it to return the last entry. Is that possible? Here is my query (prepared query): SELECT stamp_user, stamp_date, stamp_type FROM rws_stamps WHERE stamp_date >= ? GROUP BY stamp_user ORDER BY stamp_date DESC My table looks like this: What I...

How to load mysql dump to hsqldb database?

I have a sql file that creates a database in mysql: SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ; USE `mydb`...

Populating query results with empty rows

I have the following query which I use to return the highest scores in a game but I would like it to be populated by empty rows if there is less than 10 records: SELECT id, MAX(score) mscore FROM scores WHERE id IN (".implode(',', $data).") GROUP BY id ORDER BY mscore DESC" The logic is that an array of user IDs will be passed to the ...

MYSQL Error 1064 when importing stored procedures

I'm importing a stored procedure which I just exported from my development server into my production one and I ran into the following error in phymyadmin. SQL query: Documentation $$ CREATE DEFINER = `devuser`@`localhost` FUNCTION `get_refundable_amount` ( enrol_id INT ) RETURNS double( 10, 2 ) READS SQL DATA BEGIN DECLARE refundable_a...

mysql grouping problem

Hello folks, I have the following table: date1 date2 sc cash date "2010-09-20" "2010-09-21" 202 300 "2010-03-01" "2010-09-20" "2010-09-21" 202 600 "2010-08-01" "2010-09-20" "2010-09-21" 202 670 "2010-08-20" "2010-09-20" "2010-09-21" 202 710 "2010-09-01" "2010-09-20" "2010-09-21" 202...

Linq to SQL using group By, and order by count

Hello, This is mysql query: SELECT count(PVersion), PVersion FROM [Products].[dbo].[Active_Details] group by PVersion order by count(PVersion); What will be its LINQ to SQL. ...

XOR Constraint in Mysql

Hi. I want to implement a kind of xor constraint on foreign keys in mysql 5.1 There is this table, let's say Entity which can refer to two different kinds of valuesets represented by Tables ValsA and ValsB. Now I would like to implement a constraint wich makes sure that exactly one of those two is mapped, and the other one isn't. In ...

Handling tree in a MySQL procedure

The idea is simple - I have two tables, categories and products. Categories: id | parent_id | name | count 1 NULL Literature 6020 2 1 Interesting books 1000 3 1 Horrible books 5000 4 1 Books to burn 20 5 NULL Motorized vehicles 1000 6 ...

concat the output of the subquery?

i have a query which would return values but i need them as a single output separated by commas.. So i tried to concat the output with the comma but it didn't work? select id from videos where duration=0; /// this would return some rows I tried concat and concat_ws but didn't work select concat(select concat(id,',') from videos w...

connect ot MySQL from PHP problem

Trying to install roundcube webmail - had some issues related to driver configuration - I'm now pretty certain the driver is configured ok now - i'm getting an error form it : "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected hos...

Why is this query failing?

When I run this query: SELECT m.tag_id, m.product_id, count(m.product_id) as dups FROM product_tag_map m INNER JOIN category_tag_map s ON s.tag_id = m.tag_id INNER JOIN cart_product p ON m.product_id = p.product_id WHERE m.product_id = p.product_id AND s.category_id =508 AND s.include =1 AND dups = (SELECT count(s.category_id) as cats F...