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...
1 year 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...
1 year 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...
1 year 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 ...
1 year 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...
1 year 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...
1 year 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...
1 year 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. ...
1 year 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...
1 year 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...
1 year 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...
1 year 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...
1 year 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 ...
1 year 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 ...
1 year 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...
1 year 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...
1 year 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...
1 year 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 ...
1 year 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...
1 year 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...
1 year ago