Hello.
Lets say i have the following scores table (total rows of 10):
rank userid score
---- ------ -----
1 |455 |10
2 |435 |9
3 |354 |8
4 |342 |7
5 |343 |6
6 |123 |5
7 |125 |4
8 |128 |3
9 |5 |2
10 |6 |1
the user can fetch his score status, and he can get 5 score positions around hi...
I have a table in MySQL:
SID DID MessageType DateOf Message
1 255 LOG 2010-01-17 15:02:05 Log msg 1
2 255 USER 2010-01-17 19:02:05 User msg 1
3 211 LOG 2010-01-17 15:06:55 Log msg 2
4 211 ADMIN 2010-01-17 22:06:55 Admin msg 1
I need to get last (by DateOf) Message and MessageType, groupped by DID,
ord...
I am using MYSQL.
I have a varchar field which i incorrectly used for a price. Now the ordering of this table will not work correctly putting anything over 1000 to the bottom of the list.
I need to convert this price field in an existing POPULATED database from varchar to decimal i guess?
Any help would be appreciated.
...
I have a website that currently collects information when a comment is left (Name, number etc...) but right now I just have a PHP script that sends an email to me with that info using the mail() function. I don't know if MySQL might be extreme, but Id like a way to put their info into some kind of database. Thanks!
...
Hi.
if i have for example a scores table:
user game score timestamp
1 50 50 date
2 60 40 date
3 70 25 date
4 80 18 date
and i run the query:
select user, game, max(score), timestamp from scores
i will receive the maximum score number that is 20, but the rest of the columns that ...
Hi,
I've just installed python 2.6 on my win7 machine.
Now I tried to install mysqldb. But when run "python setup.py install"
C:\MySQL-python-1.2.3c1>python setup.py install
Traceback (most recent call last):
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "C:\MySQL-python-1.2.3c1\setup_windows.p...
I need to write queries to find out new users and regular users.
new users are the ones whose uuid appeared in last 24 hours (from now minus the time query is fired) in table2 and was not there before.
regular users are the ones whose uuid appeared in last day in table2 and was also there at least once in the last 3 days.
In addition ...
I have table in my DB called "students" contains the following columns
(student_id, student_name, year_of_birth).and array of years
I trying to make one query that gets 10 student_id of each year in (years) array.
I could write
SELECT student_id FROM `students` WHERE year_of_birth=1950 LIMIT 10;
SELECT student_id FROM `students` WHERE...
I am trying to move from a mysql set to a postgres one, and one of the fields that I'm having trouble moving is a mysql LBLOB. I am trying to move it into a LargeObject type in postgres and I'm having some speed issues. I'm doing this in Java/Groovy and, frankly, the streaming business has me confused.
I've tried two approaches: Hold...
We have a database that was backed up from a Linux 64 bit version of MySql that we have restored onto a Windows 32bit version of MySql.
We have a table with about 4.5 gig of data - the main space being consumed by a BLOB field containing file data. The table itself only has about 6400 records in it.
The following query executes on the ...
I would like to make a web-based game which is Travian-like (or Ikariam-like). The game will be in PHP & MySQL-based. I wonder how can I achieve the live updating of game attributes.
For frontend, I can achieve by using AJAX calls (fetch the latest values from database), or even fake update of values (not communicated with server).
Fo...
Hi Gurus,
I have three tables
Tasks with columns Taskid, Taskname
TaskAllocations with columns Taskid, EmpNum
TaskEntries with columns TaskId, EmpNum, WorkedDate, Hoursspent
Now I want to get all the task entries along a particular week. Here my problem is even if there is no Taskentry for a particular task I should get atleast a r...
I have downloaded a SOLR release, and sun JDK. I have installed SUN now...
I am using wampserver on my computer, to test SOLR out first, and learn how it works...
I don't understand how to install it and use it though... I am completely new to it and java as well, so I need some help on this one...
After downloading it, and unzipping i...
I have a MySQL 1.5 GB MyISAM-table (1.0 GB data, 0.5 GB indexes) in production which I'm about to convert into InnoDB.
Since the table is used in production I'd like to make the downtime as short as possible.
My questions:
What MySQL configuration options should be adjusted in order to speed up ALTER TABLE table_name ENGINE=InnoDB;?
...
I have managed to install SOLR and run the admin interface...
I have no clue on how to add indexes to SOLR...
I have a virtual server (wampserver) and in the SOLR tutorial they are referring to a TERMINAL all the time... I guess they mean the LINUX terminal or something, but how should I do the same thing in windows OS?
For instance,...
How can queries like
SELECT * FROM sometable WHERE somefield LIKE '%value%'
be optimized?
The main issue here is the first wildcard which prevents DBMS from using index.
Edit: What is more, somefield value is solid string (not a piece of text) so fulltext search could not be performed.
...
Last month I had to reinstall Windows and I've moved the WAMP folder to another partition. Now I've installed WAMP again but I need the old database. How can I take the old MySQL database from the saved WAMP folder on the safe partion?
In the wamp/bin/mysql/../data/ I have my old databases. If I copy the database folder only, in phpMyA...
Having a Mysql database, I have to select all ( TUser.Name, TAccount.Name ) pairs if TUser.name not exists in variable @UserNames.
If exists, I have to select only the ( TUser.Name, TAccount.Name ) pairs where TUser.name in @UserNames.
Something like the last line of the below query :
DECLARE @UserNames = "Alpha, Beta, Gama";
SELECT...
I am trying to do a multivarible (9 variables) linear regression on data in my mysql 5.0 database (the result value field only has 2 possible values, 1 and 0).
I've done some searching and found I can use:
mysql> SELECT
-> @n := COUNT(score) AS N,
-> @meanX := AVG(age) AS "X mean",
-> @sumX := SUM(age) AS "X sum",
-> @s...
I have understood how to add xml files to SOLR and be able to search them via the SOLR ADMIN interface...
I need to know however, how to make SOLR work with PHP, and index MYSQL records...
This is what I want to do:
I have a mysql table, which I would like to add to SOLR (index it), so that instead of searching the MYSQL table directly...