Skip to content
Advertisement

Tag: mysql

Omit certain characters from Rows in SQL

I have a column that has Serial Numbers but some of them has unwanted characters attached with the Serial Number:- These are some of the entries from a Column in a SQL Table. I want to omit all the characters including and after the Underscore. For example, these values would become this:- 8558088363_AAC = 8558088363 7272505721_R2C = 7272505721 And keep

How could I use case within join and union?

I have 2 tables: Matches Rounds Inserts My query: I would like to know what places a particular team achieved (should probably use HAVING m.matchwinner = ‘fnatic’) MatchID – Team – Place 1 – fnatic – 1st 3 – fnatic – 3rd 4 – fnatic – 3rd what places all teams achieved MatchID – Team – Place 1 – fnatic

Get the last entered id from a table in sql

enter image description hereI have an employee table. In that table I have n number of loan.. Now I want to select all the employees with his last taken loan value and date.. can anyone help me out in this. There’s what I’ve done so far: I tried group by, limit and order by for this but of no use…

mysql query – clash between not in and/or

I’m trying to get all my products , from A specific categories and without some products from those categories . i did this query: The problem is that i’m still getting products with the string ‘SPLA’ or ‘SA OLP’ – because the NOT IN clash with the categories How to solve it ? Answer As a starter: always use standard

SQL trying to use a column from a joined table in a subquery

Here is what I currently have which returns 3 columns for patient_id, group_concat_1, and group_concat_2: However, I need to return a single column with group_concat_1 and group_concat_2 combined, so I tried this: But his clearly doesn’t work since now it can’t find patient.id in the inner subquery. Any advice? Thanks! Answer You can concatenate directly the 2 columns:

Get a group of records by last unknown id

I have a log table where I want to select the entries for a specific group of records that are grouped by an id I don’t know. See the table below, there are more columns but these are not relevant for the question. I want to get the last entries of one process for one device When I query something

Advertisement