Postgresql : how can i get desired output as described below

SQL
I have a table named Box : Box contains the following items : 1. pen 2. pencil 3. scale 4. eraser 5. sharpener The actual table structure look...
3 years ago

Time type column field data update in mysql

SQL
I have a time type column in database and i want to update current stored value. I wrote this query but data is not changed. UPDATE testing SET timev...
3 years ago

MySQL Database in XAMPP is stopped

SQL
I'm running Xampp on Linux(Ubuntu 14.04) and while everything was working fine until an hour back right after I shut it down it suddenly starts throwi...
3 years ago

Access SQL Calculation in SELECT make not null

SQL
I have a query that filters results for products which have had orders sent after an user-input date, and calculates what the quantity becomes if the ...
3 years ago

SQL Foreign Key command won't execute

SQL
when trying to execute a SQL statement that will assign foreign keys to my database I receive an error, am I missing something simple? CREATE TABLE `...
3 years ago

Sorting a column with numbers, strings and nils

SQL
I have a column that includes numbers (as strings), strings and nils. I would like to order all numbers by numerical values, then strings alphabetical...
3 years ago

PostgreSQL one to many pivot with crosstab

SQL
I am trying to build a one to many query in PostgreSQL that looks at a customer table, a transaction table and the result is a table showing which pro...
3 years ago

Getting grand totals with grouping sets

SQL
I am migrating SQL SERVER 2005 to SQL SERVER 2014 and came across this problem. I have a "search engine" STORED PROCEDURE that builds report queries o...
3 years ago

Show the sql Django is running?

SQL
Is there a way to show the SQL that Django is running while performing a query?
3 years ago

Error when posting data into SQL database from form

SQL
I'm trying to post data into an SQL database from a form. I really don't understand what I am missing... I tried several things I managed to make it ...
3 years ago

Show last update date

SQL
I am new in this forum and also new in SQL my question is I have an Excel sheet link to database with "From Microsoft query" I have 3 tables link tog...
3 years ago

SQL Select statement not returning desired columns

SQL
I have a table (sample) with 10 rows, that has columns of place_name, 5 days worth of data (day1, day2,...,day5) for each location, and a sum column (...
3 years ago

list of states with the total number of units that have been sold to that state

SQL
I am still new to SQL, and have to complete the tasks at hand. The task is: A "fake" user has made a few orders. DELETE the user account along with al...
3 years ago

How to use union of two queries in SQL that has order by and count()

SQL
I have following two queries how do i use union so as to see both the results in the single query execution select TOP 1 AGE, DIAGNOSIS_CODE_1, count...
3 years ago

Mysql Invalid datetime format: 1292 Incorrect datetime value

SQL
mysql> describe taps; +-------------+-------------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default ...
3 years ago

Complexed Query - Sort by newest with average of 2 other values

SQL
I'm trying to sort by date and average likes/dislikes. Picture #1: 5 likes, 2 dislikes, created 1 week ago Picture #2: 5 likes, 2 dislikes, created ...
3 years ago

Access denied while running Mysql for the first time on Centos

SQL
I just installed Mysql for the first time on a CentOS machine using yum. The installation had no errors. Then I followed those steps: $ sudo /sbin/se...
3 years ago

SQL SELECT LIKE (Insensitive casing)

SQL
I am trying to execute the sql query: select * from table where column like '%value%'; But the data is saved as 'Value' ( V is capital ). When I e...
3 years ago

Get a single row from multiple rows of a single table

SQL
I have a table as given below. Here some data also added. CREATE TABLE [dbo].[ApplicationState]( [ID] [varchar](8) NULL, [S...
3 years ago

Persistent "unique constraint violation" on an empty table while inserting

SQL
Let's assume I'm managing a simple table. Additionally, each user can indirectly create a copy of each row and modify it on their own. Here's my setu...
3 years ago