Skip to content
Advertisement

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 an update statement.

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., EW20) then return the enterprise level row (e.g.,

How to join 3 tables and get the field with 2 different conditions?

I have 3 tables: Students, Courses (important field Points), StudentCourses (important field Grade). The exam is passed if Grade is greater than or equal to 70, so student will receive Points. If Grade is less than 70, student will not receive Points. Student is graduated if sum of his credits is greater than 10. I need to select StudentName, sum

find total unique number of hackers who made at least one submission every day and find the hacker_id who made maximum number of submissions each day

Find total number of unique hackers who made at least submission each day (starting on the first day of the contest), and find the hacker_id and name of the hacker who made maximum number of submissions each day. If more than one such hacker has a maximum number of submissions, print the lowest hacker_id. The query should print this information

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 can you use

Advertisement