Definitions:
In the results, * denotes an empty column
The data in the tables is such that every field in the table has the value Fieldname + RowCount (so column 'a' in row 1 contains the value 'a1').
2 MySQL Tables
Table1
Fieldnames: a,b,c,d
Table2
Fieldnames: e,f,g,h,i,j
Task:
I want to get the first 4 rows from each...
I have the following 6 integer db columns:
Year
Day
Month
Hour
Minute
Second
I need a query that takes these values for every row, combines them into a DATETIME and puts into another column.
...
Hello,
we are getting a SecurityException when using Entity framework on godaddy. The entity has been configured against a MySql store. (v. 6.1.2) A bit of wierdness with the exception though... Looking at the exception stack it seems to imply that if we open up a connection to MySql anywhere in the site, then we should get the same...
Hi, I want to be able to seach in my table named "map" to see which record has the highest value for "positionV".
For example if I had 5 records in "map" table and under "positionV" the values for each were, "3, 8, 9, 2, 10" I would wont it to output 10.
I am using PHP also by the way.
...
How can I write an sql statement that returns a list of how many students had lessons for each of the last 12 months?
so I would expect output something like:
+--------+----------------+
| Month | No of Students |
+--------+----------------+
| Oct 08 | 12 |
| ... | ... |
| ... | ... |
| Sep 09 |...
We're in the process of moving a set of websites from one webserver to another. The new server is running MySQL 5.0 whilst the old one was running MySQL 4.0 and we are getting an error on a couple of pages where a sum is being performed. I've had a look at the documentation for the differences between MySQL versions and I can't see any r...
hey i am having a real headache with this problem.
I have a a menu, i am trying to pupulate it from mysql, this is my result from my sql
Axel - rubber - brake
Axel - rubber - nobrake
Axel - paste - brake
Wheel - rubber - brake
first row is first level of the menu and so on...
so right now the menu is full of duplicates, is there an...
I have two tables, product and sold_record. product contains my list of products, while sold_record contains all of my transactions. How can I select a distinct list of products that both customer A and customer B bought?
...
Hi,
I am writing a stored procedure that needs to execute a .sql source file. The MySQL stored procedure must run the .sql script and provide a return value based on whether the .sql file exists, if an error occurs or if it exists and executes without errors. Can anyone provide me with some direction on the proper syntax to use in my ...
How to set the initial value (for example for "id" column) that start from 1001??
I do a insert "INSERT INTO users (name, email) VALUES ('{$name}', '{$email}')";
Without specify the initial value.
...
Using MySQL, when I have a table with (for example) three keys (one primary, auto-increment, and two uniques on a column, eg. 'code' and 'name'), how can I (efficiently) know which uniqueness constraint was violated when doing an insert?
You get an error #1062 - Duplicate entry 'Value' for key 2 , but how do I know key 2 is the key for ...
Let's say that we have a dictionary of about 250.000 words. Algorithm should take in 12 letters as an array or a string and find the permutation (or is it variation or combination?) that matches longest word from a dictionary. So, it is not a real permutation, as not all of the letters are used.
Of course, one can always brute-force it,...
I am working on a program to allow a user to edit data from either a MySQL DB table, or an uploaded CSV file.
I am curious as to what format i can bring the two data types into where i can code a singular presentation model to present the data to the user. Should i convert the SQL to CSV, or try to go through both types and do something...
I am currently working in an site which needs to get the birthdays of friends who are celebrating their birthday this week, this month and next month using MYSQL and PHP.
How would I go about this?
...
Hi, I have been trying to get MySQL stored procedures running with the linq templates in Subsonic3. I added some functions to the MySQL.ttinclude file that seems to have generated the stored procedure reference classes. However when I run the code and call the stored procedures I seem to always get NULL results:
public DataSet SPTot...
I have an array with 1440 vars in it.
something like:
$array = array(1 => 45.76, 2 => 67.56, 3 = 79.23 ..... 1440 => 20.22);
This array is serialized and inserted into MySQL table with longtext as field type.
What I'm facing now is a table with 700MB of data and that will mean some serious problems in the near future.
Is there a bet...
I'm trying to fetch some data from a database.
I want to select an employee, and if available, all appointments and other data related to that employee.
This is the query:
SELECT
TA.id,
TEI.displayname,
TA.threatment_id,
TTS.appointment_date,
TEI.displayname
FROM
tblemployee AS TE
LEFT OUTER Join tblappointment AS T...
I'm creating a table with 30-50 columns. There are about 200K of these rows. Is it recommended to store this data in separate tables? Are there performance issues when you have this many columns.
I'll explain a bit about the table. I have to store all sports games over the past 10 years (basketball, baseball, football, hockey). Fo...
I have a trigger on INSERT in MySQL 5.1. I want to know, how many times per second is it called. How can I do this?
...
Most questions about tenancy are centered around multi-tenancy database design issues. I want to know about single tenancy but multiple applications. The software I'm developing allows for a single user to create, from a single code base, multiple applications(I call them "sections"):
user could create a blog inside domain.com/applicat...