Skip to content

Tag: sql-server

My script has no effects in more than 3 rows

The script works fine when it has 2 rows. Stop reading from 3. This is MSSQL Server 2005. Try anyway without any result. There is no error message. But if I have more than 10 rows, it doesn’t affect the row that should affect. Answer Given the new information in your comment you should simplify this to …

SQL select based on column value

We have a DB table that contains company job codes like so: The ‘***’ in company represents an enterprise level job code which can be overwritten at the employer level (DEU, DEC). I need a select statement that returns rows with the following conditions: If there are no company specific Codes (e.g…

How to include a variable in a block WITH..AS?

I have this query to retrieve for each employee, his main and secondary function: Output : I want to integrate my previous query in the source query of my dimension : My expected output will be (for employee having EmployeeId=1) : Answer When you say: How to include a variable in a block are you asking how ca…