Skip to content
Advertisement

Tag: sql

Where to use WHERE clause in this query?

I want only results WHERE COUNT = 0, but every way I tried making this query it failed. Please help! Answer Use HAVING. For example: HAVING filters “resulting rows” after they are aggregated. WHERE, on the other side, filters rows before they are aggregated. Or… you can use an anti-join:

Save few values to the row in Postgres [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 3 months ago. Improve this question Is it possible to save few values to the row. For example, I have 2 tables: For Participants: And for Voters: I want to get

Check all possible connection exists

I want to check for all connections between two table exists and return all rows specifying weather the connections exists or not for example here is my tables: Permissions: index Controller Action 5 Error index 2 Home index 3 Home login 4 Home logout 1 Test index 9 UserManagement createUser 8 UserManagement editUser 6 UserManagement index Roles_Permissions: Roles Permissions 1

How do I used distinct to remove duplicates in this query?

I have the following table: Table I am trying to write a query (that I will include in another query) to display how many account numbers there are per symbol. I wrote the following query: The query displays like this but it counts the same account number multiple times per symbol. EURUSD should have 3 and USDJPY should only have

How can I return the Maximum Letters for a particular location using SQL?

I have the following table: TicketNumber FullName Type ActionTaken CPZName DateReceived DateResponded A306250992 Robson de Souza letter Re-issue Notice Lannisport 06/09/2022 2022/10/06 10:35:48 A306180194 Rivaldo Vitor Borba Ferreira email Re-issue Notice Lannisport NULL 2022/01/06 12:07:05 A306054145 Ronaldo de Assis Moreira User Note Hold For 14 Days Jurassic Park 06/09/2022 2022/11/06 20:53:16 A307716063 Wayne Mark Rooney email Re-Offer Discount Atlantis NULL

SQL STUFF FOR XML with specific grouping

I’m working in SQL Server 2014, and I have the following simple data, which tracks calling history of users: I need to group the ACTIVITY values into one field, which effortlessly be done using the STUFF FOR XML function: However I need to conditionally group these, on the condition that there was more than a 90 day between the activity

Advertisement