MYSQL and COUNT IF
enter image description herei have folowing table with emails an integer I would have to add up all the integers and group them with the email to get a result EMAIL | COUNT. is something like that possible? I try…
enter image description herei have folowing table with emails an integer I would have to add up all the integers and group them with the email to get a result EMAIL | COUNT. is something like that possible? I try…
I need to find a pattern which will give me a substring which follows logic to substring from the right side, after the third _. What I want to achieve is to retrieve everything up until 3rd _ . I…
I am currently transitioning from an older version of SQL Server to a PostgreSQL environment. I am having trouble finding a way to compare a timestamp's age to a set value. This is in the where clause as the goal…
I have a MySQL transfers table with the following structure: CREATE TABLE `transfers` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `id_account_destination` bigint(20) unsigned NOT NULL, `id_account_origin` bigint(20) unsigned NOT NULL, `amount` decimal(10, 2) signed NOT NULL DEFAULT 0, `created_at` datetime…
I upload daily sales data into MySQL (Workbench) (AWS). Right now, our method of uploading regular dates like 5/10/2023 is to keep ANY AND ALL columns that include dates as a data type of VARCHAR. As a result I can't…
I need to insert into a table (groupL) two rows (custId, aName). custId is constant while aName is multiple records of variable size based on a nested subquery. That subquery is: SELECT aName FROM artwork WHERE artwork.title IN (SELECT title…
I have a notifications table which stores userID,isRead,type,message UserID is id of user. isRead stores 1/0 for read/unread. Type stores the kind of notification, "mention/follow/reply". message is message which the user will see. I need a group by query that…
I have three tables project (id, user_id, project_name) project_roles (id, user_id, project_id) users (id, nickname) I want to fetch all projects for user that has id 1 and I also want to get projects where this user has record in…
I have company and user as many to many relationship. A company can have many users and a user can have many companies. I have the following tables: Company (id, name) User (id, name) User_Company (userId, companyId) How do I…
In MySQL version 8 series, there is SQL that uses aggregation functions such as count. LEFT JOIN is performed, and the pattern with "IS NULL" specified in the WHERE clause behaves differently than the pattern with "IS NULL" specified in…