Skip to content
Advertisement

Tag: sql-server-2019

Does Adding Indexes speed up String Wildcard % searches?

We are conducting a wildcard search on a database table with column string. Does creating a non-clustered index on columns help with wildcard searches? Will this improve performance? Proposed Index: for this query Currently using Microsoft SQL Server 2019. Answer Creating a normal index will not help(*), but a full-text index will, though you would have to change your query

How to select a specific number of rows and convert them into named columns

I am hanging on this problem for hours. A very simple query: SQL Result: RoomId WaterMeterNumber 95E5ACE0-FEE4-4D33-BC22-0DCF7B1155CF SZ12800491 95E5ACE0-FEE4-4D33-BC22-0DCF7B1155CF 3375791 95E5ACE0-FEE4-4D33-BC22-0DCF7B1155CF 45332 95E5ACE0-FEE4-4D33-BC22-0DCF7B1155CF SK9649 And I want the query result to be like that: RoomId Number1 Number2 Number3 Number4 Number5 95E5ACE0-FEE4-4D33-BC22-0DCF7B1155CF SZ12800491 3375791 45332 SK9649 I always want to show the numbers of the first five watermeters of a room.

Advertisement