Category "mysql"

MySQL Pivot Query with Sum of column value

Table 1(reports) - Structure with Data id distributorId clientId amount 1 1 162 2500 2 2 163 3500 3 3

How to do a silent install of MySQL in Inno Setup?

I would create a setup program for my Java application. It uses a MySQL database. So the installation of my program must include the installation of MySQL serve

phpMyAdmin Accepts NULL in the NOT NULL field

I've created a table with some NOT NULL columns using phpMyAdmin. CREATE TABLE `TEST` (`ID` INT PRIMARY KEY AUTO_INCREMENT, `Firstname` V

Short-circuit UNION? (only execute 2nd clause if 1st clause has no results)

If I do: SELECT * FROM A WHERE conditions UNION SELECT * FROM B WHERE conditions I get the union of the resultset of query of A and resultset of

Grouping into interval of 5 minutes within a time range

I have some difficulties with mySQL commands that I want to do. SELECT a.timestamp, name, count(b.name) FROM time a, id b WHERE a.user = b.user AND a.id =

Difference between timezones America/Los_Angeles and US/Pacific and PST8PDT?

I need to convert a bunch of dates in a MySQL database from Pacific time (America/Los_Angeles) to UTC. I found a great SO answer on how to do this. During my t

Database schema for messaging to multiple users

I'm looking for the best solution to implement messaging to multiple users within the system(Facebook-style). I'm came up with the following idea: where each

Mysql Database cannot start in XAMPP for Mac

Mysql Database suddenly cannot be start in my Mac. I already tried to run sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start but it show the error ../Ap

Fatal error: Array callback has to contain indices 0 and 1

I am getting this error: Fatal error: Array callback has to contain indices 0 and 1 in C:\xampp\htdocs\phpprojects\plapp\worker.php on line 53 How can I s

Unable to connect to any of the specified mysql hosts. C# MySQL

I am getting the above error when I execute the code - MySqlConnection mysqlConn=new MySqlConnection("server=127.0.0.1;uid=pankaj;port=3306;pwd=master;database

MySQL connector 6.3.5 with .NET 3.5

I am developing a project in Visual Studio 2010 on a 64-bit Windows 7 machine. I have been able to successfully connect to a local MySQL database without any is

In Clause in mysql with sql injection

I have written an mysql update query in PHP with preventing sql injections as: UPDATE table1 status = 1 WHERE id IN ( ? ) and active = ?, array(implode(',' $id

mysql update query throwing syntax error

I am trying to update user information (phone number) but mysql showing syntax error. Here is the query for showing all data (phone number) select distinct a.

Fetching rows added last hour

I keep a record of logins in a table. I have columns for id, ip, date and time. From that record of logins I wanna fetch logins made only in the last hour. I'

How do I get friend list from Friends table with counts of friends of my friends

How do I get friend list from Friends table with counts of friends of my friends (Count not of my friends) Friends table" tbl_users_friends Field 1: id Field

How to return NULL when result is empty?

I have a simple query that selects one field and only one row, thus one value. Is there any way to make it return NULL if the query results in an empty set? In

MySQL default time format UTC or GMT?

Hi I'm so confused with this UTC and GMT I'm inserting in MySQL table as ex column "event_date" like "2010-07-01 23:50:00" (datetime) my client asking an opti

MySQL Query error using UNION/UNION ALL and Group By

Generate the following two result sets: 1). Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of each

java.sql.SQLException: No database selected - why?

the last days I was trying to learn how to access mySQL databases via Java. I am able to load the driver and get a connection to the database ( at least I thin

which shipping mode has the highest number of delayed orders

I'm in the middle of an SQL tutorial, and the question is which shipping mode has the highest number of delayed orders. The code i have tried using is as given