Tring the following query but i get; Error Code: 1055. Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘PDC.PLG.LogDateTime’ which is not functionally …
Tag: mysql
How to update attribute based on result of aggregate function
I am new to mySQL. I want to update the order price of a table, based on the value of the retail price and the quantity of the product ordered. I have the following tables (simplified for this …
How to split a column in two columns
I have an issue with a table called “movies”. I found the date and the movie title are both in the title column. As shown in the picture: I don’t know how to deal with this kind of issues. So, I …
how to write group-by query SQL with quantity unit conversion?
Stock Product Quantity Unit ——————————- 001 5 box 001 10 bottle 001 60 gallon Conversion Unit1 Unit2 Rate ———————- …
Update table using select and where
I have two tables: table ficha_atendimento int id string cidadaos_cns table cidadaos int id string cns I need do create a column int cidadaos_id on table ficha_atendimento_cidadao and I like to …
How to get list of movies based on genre and language
I have stuck to get list of movies based on genre and language. Here’s my database structure: movies table ———————– id | title| ———————- 1 | ABC 2 | PQR 3 | MNC …
Derby – java.sql.SQLException: Column ‘table.column_name’ not found
I have these 2 tables: inventory and product_categories both tables have a common column called businessId. Now I have 2 databases, one is hosted on MySQL and the other on Derby both databases have same table structures. So I’ve been executing the following query on both databases: When I execute the qu…
How to get the number of new subscriptions and the number of subscription renewals in SQL?
Having this table representing users subscriptions: CREATE TABLE `subscriptions` ( `id` int(11) NOT NULL, `email` varchar(255) DEFAULT NOT NULL, `created_at` datetime NOT NULL ); There can be …
List the Employee details for any Employee that has the highest salary for their species expertise
The question is: List the Employee details for any Employee that has the highest salary for their species expertise It is to be solved using Employee and V1 table (v1 is a view created using …
Cannot return the record that match the condition
I have a table which contains a list of match: id | datetime 2864049 2019-04-03 00:00:00 2864050 2019-04-03 00:00:00 2864051 2019-04-03 00:00:00 Essentially, I have to check …