Skip to content

Tag: sql

Subselect on multiples values with like operator

How to subselect on multiple values where like operator is included? I build Table B with the ‘%’ to get all values from Table A with the like-operator. I can get the I-values from Table A with SELECT * FROM TABLE A WHERE VAL LIKE (‘I33.%’) but i build Table B to go through the whole t…

Convert from sql query condition to REGEXP_LIKE

I am converting an SQL query condition like: I tried to execute query in Oracle using condition belove but no result return: Result look like for example 169011310 so _ are numeric characters Answer The $ in regex means end of string, you need to remove it because % in TSQL means any text, any zero or more ch…

SQL Server: update rows that take part in grouping

I’m using SQL Server 2017 (v14.0). I have two tables with one-to-many relationship. I need to group the rows in the “Orders” table and by this info create the row in the “Transactions” table, then I need set the relationship – for a created transaction I need set the Transa…