I have a sample data here: What I need is for each product_id, the least number is each level Expected result But as I have multiple rows for the same product id, it selects blank over 184 in level 4 Answer You can use case when you aggregate to filter out the 0 values: Note: You could also write the
Tag: substring
How to get string after character oracle
I have VP3 – Art & Design and HS5 – Health & Social Care, I need to get string after ‘-‘ in Oracle. Can this be achieved using substring?
Hide characters in email address using an SQL query
I have a very specific business requirement to hide certain characters within an email address when returned from SQL and I have hit the limit of my ability with SQL to achieve this. I was wondering if someone out there would be able to point me in the right direction. Essentially, my business is asking for the following: test@email.com to
MYSQL, How to combine the first 2 letters of the first name and the first 5 letters of the last name
I’m trying to write an SQL query (using the SELECT function) that will take the first two letters of the first name and the first 5 letters of the last name, then combine them and put them in a new column called “User Name.” I’ve tried using the SUBSTRING and CONCAT functions together, but my syntax isn’t right. Does anyone
SQL: ORDER BY using a substring within a specific column… possible?
I have a database whose columns are npID, title, URL, and issue. Here is an example of two years’ entries: What I would like to do is be able to sort the results based on substrings within the “issue” column. However, until 2010, the client used seasons as the header and in 2010, they started using quarters. Is there a