I want to display each crew member, basic info, and the most recent start date from their contracts. With my basic query, it returns a row for each contract, duplicating the basic info with a distinct …
Tag: sql
Sql select from a table but use another table value as where clause [closed]
How can I select * from table posts but using table network_follow.follower as where condition? I have table posts, column by_user and table network_follow column follower I don’t know if that’s …
Joining two tables and adding column values together
I have two tables, in both tables I have a unique column titled phone_number and then a column called spring with 3 others columns. The spring column has a number value. This table has about 3000 rows….
DbContext.DbSet.FromSql() not accepting parameters
I have a database with two tables, and wrote a relatively simple select statement that combines the data and returns me the fields I want. In my SQL developer software it executes just fine. Now to …
How to make a comparison for the record that has rows to another rows? [closed]
I have first table that has columns: 1. id 2. key 3. value And second table(more like the list): key I need to get distinct id that contains all keys from second table I have tried …
To retrieve data from SQL table fields with different IDs into corresponding different variables
The sql database table named ‘data’ has the fields ‘date’, ‘project_id’ and ‘amount’. I am able to retrieve the total amount spent on a single project with the code below: $sql = “SELECT sum(data….
SQL: how to pivot dimensions in a column?
I’m looking to do the following: Raw table: this has just two articles, their traffic channels, and unique pageviews SELECT * FROM website_content_table Returns: I want to return a table that …
Cannot resolve the collation conflict between this and that
I have data from 2 different databases, which i need to consolidate and compare which each other. An example: select distinct CustomerNo from DB1.dbo.TableCustomers UNION ALL select distinct CustNo …
bad date format for pivot
together I can not figure out why in PowerPivot or Excel a Microsoft query does not provide the date fields in the format for Excel as they are necessary. I have already gotten from you in another …
Get value of column related to value of column in other rows
I’ve a current table like this and would like to obtain this desired table: As you can see, this desired table should have a fourth column which indicates me the proportional value of the price in …