INSERT with SELECT

MySQL
I have a query that inserts using a select: INSERT INTO courses (name, location, gid) SELECT name, location, gid FROM cou...
10 months ago

How To Select in mysql from Starting date

MySQL
How can I select range of dates between start Date to Maximum date available in the table (Ex. starting from 03-05-2016 to highest date available in t...
10 months ago

Nested INNER JOIN vs INNER JOIN vs WHERE: correctness, performance, clarity for a particular case (not a typical JOIN vs WHERE issue)

MySQL
I'm studying inner joins and I´m a old WHERE SQL-92 man. I'd like to know the implications and understand how it works. So this is just a theoretical...
10 months ago

2 table join and 1 group concat

MySQL
I have tables as below sales salesid |custid |date_created |total_price S0001 C0001 2015-12-31 20.00 S0002 C0002 ...
10 months ago

mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 to be resource or mysqli_result, boolean given

MySQL
I am trying to select data from a MySQL table, but I get one of the following error messages: mysql_fetch_array() expects parameter 1 to be resour...
10 months ago

write MySQL searching for more than one value in a column

MySQL
SELECT ID, Division, EffectiveDate, PM, case Status when 0 then 'Dead' when 1 then 'Active' when 2 t...
10 months ago

LOAD DATA INFILE, skipping first column in table

MySQL
I am having trouble finding the correct syntax for loading a csv file into table, while skipping the first column which already exists in the table. M...
10 months ago

How to UNION a non-union compatible table

MySQL
The question im suppose to answer is, Create a table that results from adding UNION ralational operator to BOOTH and MACHINE. This are the tables. ...
10 months ago

Using Count to find the number of occurrences

MySQL
Let's say I have a table with the following values. Ford Ford Ford Honda Chevy Honda Honda Chevy So I want to construct the following output. Ford...
10 months ago

jQuery Autocomplete doesn't load more than 250 MySQL records?

MySQL
I have a form of product where product name fild has an autocomplete feature but it doesn't load more than 250 records. If I put the limit to 300 or 5...
10 months ago

Active record query result doesn´t show all the fields with table joins

MySQL
I have the following sql query which when run from the console perfectly generates the result I want SELECT * FROM tbl_fixtures f LEFT JOIN tbl_cou...
10 months ago

Transactions in MySQL - Unable to Roll Back

MySQL
I'm using MySQL 5.0.27 and am trying to get transactions to work. I followed this tutorial: http://dev.mysql.com/doc/refman/5.0/es/connector-net-exam...
10 months ago

MySQL Between Statement and >= <= > < not working

MySQL
i cant get my between statement to work, I can get AND EffectiveDate &gt;= '2015-06-01' to work, as soon as i add another date condition it breaks. I ...
10 months ago

Order categories by number of downloads of the items in them

MySQL
I have two tables: Items | id | name | downloads | category_id | |----|--------|-----------|-------------| | 1 | Item 1 | 5 | 1 ...
10 months ago

Limiting Query Result from a for each Loop

MySQL
I have three tables in a MySQL database, from which I am populating a dropdown select box. The problem arises because I want to use a line of the resu...
10 months ago

How to make use of variable on a function

MySQL
I need to make a stored function: This is my code SELECT count(Dominio) FROM Thogar WHERE DOMINIO='%' I need to make a stored function where I w...
10 months ago

MySQL ORDER by two columns, limit on a single one

MySQL
Is there a way to ORDER results in MySQL based on a column A and B and then limit the results to X per values of A, as in ORDER BY A, (B LIMIT X)? As...
10 months ago

I want to Query in MYSql with some conditions

MySQL
Here is question with conditions: In a somewhat related situation to the above, management wants to know which technicians are certified in one trade ...
10 months ago

MySQL query to get that row which has the last day of first month of date field

MySQL
In my database I have a field named DateLastSaved: Suppose the values are: 1. 2016-05-12 08:07:00, 2. 2016-05-22 09:06:00, 3. 2016-05-22 09:06:00, 4...
10 months ago

Get total points of user in MySQL Table with PHP

MySQL
Table Hello! I have a MySQL table with the columns "user" and "warningpoints" for each warning as you can see in the table above. How can I get the u...
10 months ago