I am newish to SQL and Join statements and I am way out of my league at the moment I currently have 6 Database Tables that are all linked to the main 7th table based on the main tables ID, however all …
Tag: mysql
How to add a character to specific index in string
I have a db with email-addresses which are 15 characters in total. Some are 14 characters long and they have the same in common, they miss a 0 in their name at the 3th index. I had a what similar …
List of all table and column level privileges for a MySQL database
What is the easiest way to list all table-level and column-level privileges for a MySQL database? I need to know what level of customized access has been granted for a specific database and which users have fine-tuned access to certain tables and/or columns. Answer To list table level privileges, you can query the INFORMATION_SCHEMA.TABLE_PRIVILEGES table. The TABLE_PRIVILEGES table has these
IF Exists then update in mysql
New to MySQL, need help in translating the next query to MySQL If exists (select * from INFORMATION_SCHEMA.COLUMNS where table_name= ‘MyTable’ and column_name = ‘MyColumn’) begin …
SQL CASE WHEN (1=1) What is the 1=1 doing?
I have a SQL statement that I did not write and I am trying to get my head around it. CASE WHEN (1 = 1) THEN A.AMT WHEN (A.ACC_NO = ‘1’) THEN A.AMT – 100000000 WHEN (A.ACC_NO = ‘2’) THEN …
compare data between two tables and populate a flag column in 1st table with ‘Y’if exist else ‘N”
I have two tables, if data exist in 1st table then populate flag column with ‘Y’ if does not populate with ‘N’, I am comparing only 3 columns, one is number, 2nd is name and 3rd column is datetime. …
Nested Assemblies Database Structure
I’m creating quoting software for the manufacturing business I work for and I’m unsure how to handle assemblies within my MySQL database structure as they are a little like a Russian Doll. Here’s a …
SQL comparing column changes the last X hours
I have a table containing log entries that looks like this: id | name | level | timestamp 5 | ironman | 35 | 2019-01-06 11:37:40 6 | ironman | 35 | 2019-01-06 11:38:40 7 | ironman |…
how to do a few queries MYSQL
this is my homework, i am searching. total 17 question.I couldn’t make 5 questions but i am trying, trying.. list the number of books each student reads. But next to those who do not read the book …
between date inteval mysql not showing today
my query: SELECT p.idprd, p.nmprd, pe.idprd, pe.stockjual, pe.stockkeluar, pe.tothrgjual, pe.tgljual FROM tbproduk AS p INNER JOIN ( SELECT …