Select records which is unique – Mysql
I've a MySql table which contains rows like, pid country 436 1 436 5 436 7 439 7 440 3 446 7 446 1 For Example, I am trying to retrieve products which has only country 7 and should not…
I've a MySql table which contains rows like, pid country 436 1 436 5 436 7 439 7 440 3 446 7 446 1 For Example, I am trying to retrieve products which has only country 7 and should not…
I have tables named course, student and students_in in a MySQL database. The tables look like this: course course_id name 3 Physics 12 English 19 Basket Weaving 4 Computer Science 212 Discrete Math 102 Biology 20 Chemistry 50 Robotics 7…
I need to speed up an import in MySQL. Let's assume that i have an external table "external.prices" articleNumber price regionNumber "A0000000001" 1.90 "R1" "A0000000001" 1.99 "R2" "A0000000002" 4.99 "R1" Internally i have the following tables "internal.articles" id articleNumber 1…
I am trying to convert string '2022-12-28T22:28:43.260781049Z' to datetime format. I have such query: SELECT date(str_to_date('2022-12-28T22:28:43.260781049Z','%Y-%m-%d')) as date, hour(str_to_date('2022-12-28T22:28:43.260781049Z',"%H:%M:%S")) as hour FROM transaction And such output: date time '2022-12-28' NULL How to get time as well?
My MySQL table having column with comma separated numbers. See below example - | style_ids | | ---------- | | 5,3,10,2,7 | | 1,5,12,9 | | 6,3,5,9,4 | | 8,3,5,7,12 | | 7,4,9,3,5 | So my expected result should have…
Came across this code today: SELECT 'Overall' as Main, wave, country, catg, '' AS hw, SUM(0) AS headwinds_sum .... .... Can someone explain what ' ' in the above stands for? Its not a typo as it is repeated @multiple…
I have 2 selects that just get the SUM of IDs and are grouped by month.. I would like to have them only on 1 SELECT - side by side... SELECT MONTH(data) AS month, COUNT(id) AS TOTAL FROM numeracao WHERE…
I am running Minikube version 1.20 w/ KVM2 as a VM driver inside my Ubuntu 20.04 LTS. When I am trying to deploy SQL inside my local Kubernetes cluster. It keeps restarting with the below pod logs error 2023-01-17 07:15:17+00:00…
I'm trying to set up a docker container running mysql server. I'm following the steps from the official image. More precisely, I'm running the following commands, each in their own powershell prompt: docker run -it --rm --name MySql_EC ` -e…
Basically, how can I change the following so I don't have multiple question marks?: public static int insert(int id, String name, String address, String phone, int age) throws SQLException { String SQL = "INSERT INTO some_table (ID, Name, Address, Phone_Number,…