I have a view that's currently defined as
CREATE VIEW riders AS select ridelog.uid AS rid,sum(ridelog.distance) AS distance from ridelog group by ridelog.uid
What I'd like to do is add a second field that shows the distance y-t-d. i.e, the sum of the distances for rides that occurred since January 1st of the current year.
The problem ...
Hey Everyone,
Has anyone come across a way to import the contents of mbox files (10 megs or so) into MySQL?
Thanks,
j
...
My problem is rather straight-forward:
Retrieve an image from a MySQL database (currently stored as binary data in a blob column)
Rotate that image 90 degrees (using PHP's imagerotate)
Store the image back in the database with that rotation changes applied.
I'm having trouble finding functions that will let me save the image as a da...
I'm working on a one-time PHP (5.2.6) script that migrates several million of MySQL (5.0.45) database rows to another format in another table while keeping (a lot) of relevant data in memory for incremental calculations. The data is calculated incrementally. (in chunks of about 1000 lines)
The script stops unexpectedly in random points ...
The next function in MySQL
MD5( 'secret' ) generates 5ebe2294ecd0e0f08eab7690d2a6ee69
I would like to have a Java function to generate the same output. But
public static String md5( String source ) {
try {
MessageDigest md = MessageDigest.getInstance( "MD5" );
byte[] bytes = md.digest( source.getBytes("UTF-8") );
...
I've written a site CMS from scratch, and now that the site is slowly starting to get traffic (30-40k/day) Im seeing the server load a lot higher than it should be. It hovers around 6-9 all the time, on a quad core machine with 8gb of ram. I've written scripts that performed beautifully on 400-500k/day sites, so I'd like to think Im not ...
Hello, I will be using jQuery's functionality to create portlet widgets for my web application suit. I haven't started as of yet, but will do soon, so this is the planning
Now, currently, the page loads, and the widgets load into their default positions. A user can move them around, change their settings, whatever.
Now, my problem is t...
I have a MySQL table that holds many entries with repeated IDs (for various reasons)
So you might have something like
ID TIME DATA
1 xx xx
2 xx xx
3 xx xx
1 xx xx
3 xx xx
What query can I run through PHP to select each ID only once?
So I would like my result set to look like
ID TIME DATA
1 xx xx
2 xx xx
3 xx x...
The in-house developed software where I work connects directly to a mysql server here in our office via our devexpress orm (XPO). Performance is great.
We're opening another office... cross country. Performance: not so great. The requirement is that the software be as responsive in both offices as it is in this office and that the data ...
I think I may be missing something here that should be relatively common. How can I make all form validation errors, including field-bound errors, show up at the top of the form (global)?
...
When I define the NHibernate entity/mapping to use Guid as identity column I receive an exception. The Guid column is generated as a varchar(40), but the content seem to be binary.
Is there a solution to this? For now I'm just using plain ol' int, but it would be nice to know for future projects! :)
...
I'm trying to use adodb for db access in my webapp.
However my hosting provider has mysql case sensitive,
and I have all my fields in lowercase. But when I call getInsertSQL function,
I got them in uppercase.
Is there a way to force adodb to use lowercase?
I tried with
define('ADODB_ASSOC_CASE', 0);
$ADODB_ASSOC_CASE = 0;
But it se...
I have some tables that benefit from many-to-many tables. For example the team table.
Team member can hold more than one 'position' in the team, all the positions are listed in the position db table. The previous positions held are also stored for this I have a separate table, so I have
member table (containing team details)
positions...
I have a table with three fields, FirstName, LastName and Email.
Here's some dummy data:
FirstName | LastName | Email
Adam West [email protected]
Joe Schmoe NULL
Now, if I do:
SELECT CONCAT(FirstName, LastName, Email) as Vitals FROM MEMBERS
Vitals for Joe is null, as there is a single null field. How do you ov...
I have a MySql table called reviews which stores a lot of product reviews, accumulated over many years, each annotated with a date timestamp.
I wanted to draw a bar-chart showing me the number of reviews I have accumulated on each day of the year, hoping to find the important dates for my system.
I used this query
select dayofyear(da...
In Mysql, we can execute this where it updates the changetimestamp every time the row is changed.
create table ab (id int, changeTimestamp timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP );
Is there something similar to do the above in Postgresql?
...
I'm trying to migrate from sql server 2000 to mysql by using DTS. That's the best tool I know yet.
But one a sql server tables has a column with datetime type, the DTS suggest the following sql code:
`StartDate` long varbinary NULL,
`EndDate` long varbinary NULL,
It should be:
`StartDate` DateTime NULL,
`EndDate` DateTime NUL...
I've got two options for unicode that look promising for a mysql database.
utf8_general_ci unicode (multilingual), case-insensitive
utf8_unicode_ci unicode (multilingual), case-insensitive
Can you please explain what is the difference between utf8_general_ci and utf8_unicode_ci? What are the effects of choosing one over the other when...
What are server SQL modes?
...
mysql> select count(*) from table where relation_title='xxxxxxxxx';
+----------+
| count(*) |
+----------+
| 1291958 |
+----------+
mysql> explain select * from table where relation_title='xxxxxxxxx';
+----+-------------+---------+-
| id | select_type | rows |
+----+-------------+---------+-
| 1 | SIMPLE | 1274785 |
+---...