Click here to Skip to main content
14,975,553 members
Everything / Database Development / MariaDB

MariaDB

MariaDB

All Articles

Sort by Score

MariaDB 

Please Sign up or sign in to vote.
22 Jun 2020
Patrice T
Quote: Can't find syntax error anywhere in code Syntax error is in SQL command I would start with: SQL = "INSERT INTO Employee (Email, First_name, Last_name, Phone, Admin, Active)" ' ...
Please Sign up or sign in to vote.
23 Jun 2020
MadMyche
As Patrice and 0x01AA have pointed out, you should watch for spaces and other separators. Your statement does not have a space between the parentheses VALUES, and then an empty value at the end of the statement INSERT... , Active)VALUES(... '" +...
Please Sign up or sign in to vote.
23 Jun 2020
Patrice T
SQL = "INSERT INTO Employee (Email, First_name, Last_name, Phone, Admin, Active)" SQL += "VALUES ('" + email + "','" + first_name + "','" + last_name + "','" + phone + "','" + admin + "','" + active + "');" Not necessary a solution to your...
Please Sign up or sign in to vote.
31 Dec 2019
Oviya Sivakumar
1 alternative  
want to display that which department have least number of employee ? and department with 2nd least number? there are three tables 1)departments *dept_no *dept_name 2)dept_emp *emp_no *dept_no 3)employees *emp_no *emp_name how to join these tables and find which...
Please Sign up or sign in to vote.
31 Dec 2019
OriginalGriff
Well ... "de" doesn't exist: (select min(count(de.emp_no)) And GROUP BY needs to precede HAVING: having count(dt.emp_no)= ... group by d.dept_name; But why so complicated? A simple JOIN will do it: SELECT TOP 2 d.DeptNo, d.DeptName, de.EmpPerDept FROM Departments d JOIN ( SELECT DeptNo,...
Please Sign up or sign in to vote.
21 Jun 2020
MarissaReloaded
2 alternatives  
I have two tables, and I would like to update the running balance of expenses by retrieving the allocation(budget) based on matching voteid I'm using phpmyadmin mysql * Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6 * Database client version:...
Please Sign up or sign in to vote.
20 Jun 2020
Herman<T>.Instance
The part of the query SET @csum = (SELECT allocation FROM vote INNER JOIN expenditure ON vote.voteid = expenditure.voteid GROUP BY vote.voteid); will return mpre than 1 rows. You have to refine that...
Please Sign up or sign in to vote.
21 Jun 2020
Jörgen Andersson
You are thinking procedurally. With SQL it's best to think in sets. And you should also consider keeping the data normalized, so the need to update the balance is a bad idea, that should be queried when needed. Database normalization -...
Please Sign up or sign in to vote.
22 Jun 2020
Member 14870365
3 alternatives  
#! /usr/bin/env python3 print('Content-type: text/html\n') import MySQLdb, cgi def results_table(records): html = """
Please Sign up or sign in to vote.
22 Jun 2020
Maciej Los
Not an answer, but suggestion. I'd suggest to use PyPika · PyPI[^]. Why? Quote: The motivation behind PyPika is to provide a simple interface for building SQL queries without limiting the flexibility of handwritten SQL. Designed with data...
Please Sign up or sign in to vote.
4 Feb 2021
Member 15064692
1 alternative  
I have a stored procedure that i call with a JSON object of paired values. I can't get it to output to a table what am i doing wrong? The table should output as a table with two columns, key and value. An example input would be CALL...
Please Sign up or sign in to vote.
4 Feb 2021
Richard Deeming
Using the Jayway JsonPath evaluator[^], it seems that $.`key` will not match anything in your input document. From a quick read of the JSONPath syntax[^], it seems that this is looking for a property called key on your JSON object. There is no...
Please Sign up or sign in to vote.
14 Feb 2021
JamesV7
1 alternative  
Example Input Table: Unit Name Phone Address Email 200 Joe Bloggs 555-1234 15 Sea Lane owner1@example.com 200 Jane Bloggs 555-1235 15 Sea Lane owner2@example.com 201 Peter Parker 555-1236 12 James...
Please Sign up or sign in to vote.
14 Feb 2021
k5054
Have you tried using SELECT DISTINCT? See here: Eliminating Duplicates from a Self-Join Result | Handling Duplicates[^]
Please Sign up or sign in to vote.
24 Apr 2021
OriginalGriff
Not like that! There are two big problems here: 1) Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized...
Please Sign up or sign in to vote.
23 Jun 2020
Member 14870365
1 alternative  
HTML Employee Add Employee Table Email:
Please Sign up or sign in to vote.
24 Apr 2021
mael_baslote
1 alternative  
What I want is when a new teacher is added, it will create a table in the database with the name $param_subject1. It does create the table but I also want to insert the information of the new teacher in that created table. try{ ...