How to merge columns from two table structures into one table, and count group by one filed?

Advertisements I have two tables, City and Vehicle. Now I want to merge the two tables into one table. Then count each type of vehicle based on city. Then merge them in to one table. Could someone help me? City: City_Id City_Name 1 New York 2 Washington Vehicle: Vehicle_Id Vehicle_Type City_Id 1 Electric 2 2… Read More How to merge columns from two table structures into one table, and count group by one filed?

Trouble retrieving emoji messages in SQL query and ignored or treated as empty string

Advertisements I have the "👍" emoji stored as a message in my database. When I execute my store procedure to retrieve records where select top 10 * from t_MemberApp_PushNotifications where contactID = 10930547 and pushMessage <> ” order by 1 desc It doesn’t display the data when only emoji is present. As you can see… Read More Trouble retrieving emoji messages in SQL query and ignored or treated as empty string

SQL find multiple longest column results with its id and collect them in a single query result

Advertisements I need to find the records with the longest field answer, for example: To get the longest First_Name, Family_Name and Company, it returns 3 different records, 1 for every longest answer and its record id. SELECT TOP 1 Id, LEN(First_Name) FROM Persons Group BY Id, LEN(First_Name) ORDER BY 2 DESC Something like this would… Read More SQL find multiple longest column results with its id and collect them in a single query result

SQL How can I group rows for every id and date without duplicates in names and arrange them

Advertisements I have got a problem and I have no idea how to solve it because I’m a beginner. I have a table like this: id date time title 1 2023-03-03 2023-03-03 10:00 A 1 2023-03-03 2023-03-03 10:10 A 1 2023-03-03 2023-03-03 10:20 A 1 2023-03-03 2023-03-03 10:30 B 1 2023-03-03 2023-03-03 10:40 B 1… Read More SQL How can I group rows for every id and date without duplicates in names and arrange them