I need to get all aid’s values which have cid != 40 and cid= 39 (many-to-many connection) I’ve prepared two queries but i don’t know how to except second from first SELECT DISTINCT aid FROM …
Tag: mysql
How do I select the max(timestamp) from a relational mysql table fast
We are developing a ticket system and for the dashboard we want to show the tickets with it’s latest status. We have two tables. The first one for the ticket itself and a second table for the …
I am struggling to remove the last 30 characters from data in a column
I am looking to remove the last 30 characters from a colum within my database. I have created the below which works in the sense it shows me the result and it’s correct but it does not commit or change anything. What am I missing, I am a noob 🙂 I expect the data in the column to remove the
How can i count project status by change/update made
I want to count status change by id from to I have a mysql status table which has a name with pre implementation, implementation and operations states. a project contains project id, name, start date fields. both status and projects have a many to many relationship called project_status table contains project_id, status_id, date_of_progress. so i want to count all projects
How can I combine these 3 different queries into one?
I have 3 queries in a MySQL database that output all the same fields except the last one, which is a calculation. I would like, if possible, to combine them into one query that outputs the common …
How to search JSON data associative array mysql 5.5
I have stored JSON associative array data in the column of the table in MySQL 5.5. I want to search in JSON at one specific array key with key and value my JSON structure : So for search by Key Value, I have this query : It is working fine but my problem is that I can not select Interface_1
mysql workbench No database selected Select the default DB to be used by double-clicking its name in the SCHEMAS list in the sidebar
I’m learn sql for web design. I am using MySql WorkBench, as stated in the title I’m wondering if there something in sql code is missing. Given error: 14:59:45 CREATE TABLE branch ( branch_id int(…
Is it possible to create a table with a hh:mm time column?
I want to create a table column that has a hh:mm format. How do I do that? I’ve tried it with time(0) but that also gives me the seconds. CREATE TABLE courseTimes ( startingTime time(0), …
In MariaDB/MySQL, how do I retrieve the same column from different records returned in a single row?
I would like to retrieve a single row that shows the top three colors of products belonging to a specific set. The order is predefined and for some context, the way I would retrieve the top color is …
How to select data that doesn’t exist in other query
I’m trying to select from table data but i want the result not exist in this select. (SELECT * FROM data WHERE category = ‘A’ ORDER BY RAND() LIMIT 4) UNION ALL (SELECT * FROM data WHERE category = ‘…