I have two tables. drivers name number email requests id driverassigned …. I want to get everything from drivers table that may or may not be mentioned in requests.driverassigned. I have tried using join but it returns rows that have a match. Here is what I have so far. I am sure there is a common solut…
Tag: sql
Merge two tables in SQL, with one common column
I’m trying to merge to tables in MSSQL, as in the sample below. My situation is similiar to this question. T-SQL merging two tables with common and uncommon columns I have tried using the following query: But it results in this, where the rows that have the same value in column a, merges in the same row…
Filling a column with similar values in SQL
I’m beginner on StandardSQL My Table : I need your help to get the transactionId to be duplicated on each row instead of the Blank. My Query : Answer You already have transactionId on each row. Your query generates rows where each row has transactionId and some array. The BigQuery GUI just formats array…
BigQuery SQL to track dwell time in point of interest from location data with multiple stops
I’m working on a dataset with anonymized location data and I receive a series of time-stamp intervals at various points of interest. I’m trying to calculate the dwell time for an individual within a point of interest. I’ve tried a simple method of max(timestamp) – min(timestamp) to cal…
Rows with multiple corresponding values in the same table
Suppose I have a table Name Wear Martin Hat Martin ? Martin Shirt Alfred Tee Alfred Jeans And I only want names of people whose Wear value is fully given, …
Pass a table variable using table type into a stored procedure?
I have a table employee with around 1000 entries, I have to create a stored procedure which accepts a parameter. The parameter will most likely be of the type which I created ‘AS Table’. Upon passing …
Cannot use object of type IlluminateDatabaseQueryBuilder as array
I cannot find the error here how do i fix this? $db2 = DB::connection(‘sqlsrv’)->table(‘Checkinout’) ->join(‘Z_MemRecord’,’Checkinout.Userid’,’=’,’Z_MemRecord.uid’) ->select(DB::raw(“…
SQL: Using CASE over TABLE that has been GROUPED
I am working with an SQLite Database that has a table CarUse with three fields CarID (VARCHAR(20)), tDate (VARCHAR(20), and Kms (INT). The goal is to create a table that will summarise the Kms over …
How to select every Friday for the last six months?
I am working on the currency table. I need to get every Friday for the last six months. My query selects every day between two dates. Here my query OUTPUT OUTPUT(Should be) Thanks for helping. Answer Not clear if you are looking for Oracle or MS SQL-Server. In case you need it for Oracle you can use
Query for students passed or not passed in specific Subjects [closed]
I have a Table with Column Headings: ID Student_Name Roll_Number Subject1MarksObtained Subject1TotalMarks Subject2MarksObtained Subject2TotalMarks Subject3MarksObtained Subject3TotalMarks …