I have employee biometric log data with inoutmode flag. I am trying to get detail break time list and with time difference. inoutmode 4 as break-out and 5 as break-in. INSERT INTO `tbl_downloadentry`…
Creating Alias and setting Data Type to the newly created column withouth having to relist the alias again
USING SAS EG 7.13 I have a table where I’m creating a few alias columns that are compiled from concatenated strings gathered from other fields. I’M having trouble assigning the aliased columns a data …
Sql Azure stopped using index
Weirdest few hours using SQL Azure. We dropped the database from 50DTU to 20DTU and our CPU went through the roof. Turns out that one of our main indexes was simply no longer being used. The …
How to create a table with all the table names in my DB and for each one, the number of columns in the table
I’m new at SQL developer so I don’t really know a lot about it. I am trying to obtain (from a select) a table with the names of all the tables in my DB with its number of columns. I have tried to do …
Extracting unique values with SQL [closed]
I’m new to SQL and would greatly appreciate your help with extracting data from a hive table. The table contains two relevant columns: host and url. The url column has a lot of duplicates and …
MySQL : Insert Statement to add a record in TABLE_1
A single insert statement to add a new record in TABLE_1 for which : TABLE_1_ID value to be inserted as total count of records in TABLE_1 + 1. COLUMN_NAME will have value as “ABC”. TABLE_2_ID value …
How to count SQL data but also have a field that may be present or not?
I’m trying to figure out the right SQL query to group data but also include a boolean (YES/NO) if at least one of the rows grouped has a certain value. Here’s a concrete example to help visualize: …
How to convert PostGIS polygon coords into lat and lng?
From a json API, I am fetching data of an area displayed as a polygon. An endpoint example can be found here: https://admin.udinaturen.dk/api/v1/facilityread/?format=json&subcategory=40&limit=1 Here is a preview of the polygon displayed on the platform I am fetching the data from: http://udinaturen.dk…
Query works on SQLite but fails on SQL Server
The following query works for me in SQLite. But in SQL Server, it gives me an error. Invalid column name ‘VehId’. And the editor puts a red squiggly line under the last VehId (but not the first). As you might expect, Vehicles.Id is the primary key. I’m trying to find all foreign keys in Tran…
Why is this not saving to the database?
I’m trying to save a new product into the database, this product has exportation factors which i’m also trying to save, why is this not working? if ($request->has(‘export_factors’)) { $…