Skip to content

Tag: mysql

Query SQL values with possible empty records

I have 4 tables that I want to run a single query on. I want specific values from each table that all relate to a single user. However, some of these tables may not have any associated records. If there are no records in a given table, the query set comes back as empty (because there are no records pertaining

Create category column mysql

I have a transactions table, I want to query it using MySQL 5.7 group by vendor and count number of transaction, and categorize vendor by these criteria Great: More than 2 SHIPPED and 0 CANCELLED transactions OK: More than 2 SHIPPED and 1 or more CANCELLED transactions Mediocre: other than Superb and Good cri…

sql query to replace backslashes ‘\’ with ‘/’

I know very little about sql queries but I need a query to replace ‘\’ with ‘/’ I have a WordPress database where there are characters in a long text string that look like this in phpMyAdmin Browse. ‘\uploads\photos\’ It needs to be ‘/uploads/photos/’. I want a …

Creating query for printing average of two months [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I need to show monthly average of total using SQL and PHP. For example this table has total=…

Searching a formatted address in SQL table where columns are split

How would I go about searching (and possibly full-text index searching) on a table for address data that is structured as per below: When searching for an address I’d like to search for the whole address. Ideally I’d like to be able to search the table like this: Thanks for your help in advance An…

SQL Join – Limit to base table

I have 4 tables that I want to link together based on the information in the sales_details table which will serve as the base table (limiting results based on the sales_details table) 1)I want to pull all columns from the sales_detail table that are mastercard orders but since the sales_detail table doesn&#82…