Skip to content

Tag: sql

Aggregate rows based on MIN flag

I’m thinking this is an easy one but the answer is escaping me. Example: I have a query returning 10 rows, some of which are identical except for the last 2 columns which are a comment and a number(…

Convert VARBINARY to Base64 in MySQL

This seems like a basic scenario, but I can’t find relevant info anywhere. I’m new to MySQL, coming from years of Microsoft SQL Server experience. In MySQL, how do you convert a BINARY or VARBINARY value into a Base64 string, and vice-versa? In Microsoft SQL Server, I’ve been using code like…

Select Distinct and show records where X column is not the same

I have a database with a structure of: I am struggling to write a query to show me where ‘Supp’ is different. (Supp Should be the same for all records, So i need to identify records effected to correct) The table contains more than 55,000 lines Just a list of Codes where Supp is not the same for e…