I am working on a login system that will log a users IP for a day after they login and clear it after one day. I know you can delete rows but i don’t know how to clear a row. The table i have is this. …
Tag: sql
How do I add a count() for one table into a SQL query that has joins for multiple other tables using SQLite?
I have a sql statement that pulls data from multiple tables. This query gets all employees and their biographic information (employee id, first name, last name, badge image, etc.): SELECT e.ID as id, …
SQL Query to return filters applicable to products contained in category AND filters that apply from remaining products once 1+ filters active
I’m displaying a list of product filters. Product filters are only displayed if they are applicable to the products contained within a chosen category. I want to expand that further so once a filter …
SQL Server Select Query With Join/Sub Query On Same Table To Create A Master Field Value
This is a weird query, and I’m not sure if what I want to do is even possible (Efficiently anyway) as it’s a bit of a weird situation. Let’s say I have the following data called ProductTable. They …
SQL groups inside groups
I have transaction data like this example: Name | Price George | 20 George | 20 George | 20 George | 30 Paul | 20 Paul | 20 Paul | 30 Paul | 30 Paul | 35 I need to group by …
How to search for separated values in cloumns from a merged values column
I have a database where the data I need to work with is stored into two different columns. I also need to import an excel file and the data in this excel file is all together only separated by a dash. …
Select Specific Column from a Linked Server Table
I have the following C# code to select a column from a table that is on a linked server: var query2 = $@”select [FileName] from [AMS_H2H].[H2H].[dbo].[FileReconciliation] where ProductCode = @…
python sql insert statement inserting values with quotes in database
I am trying to insert data into Mysql in python using the below statements Here id =”75″, plantcode=”2″, pcode=”FG” But my values in database are inserted with single quote in mysql database i.e ’75’,’2′,’FG’ I do not why the values are i…
Any way to get a more meaningful error message in postgres?
Let’s have some tea … CREATE OR REPLACE FUNCTION allRelevantTeas() RETURNS TABLE(tea_id INTEGER) AS $function$ DECLARE result REFCURSOR; stmt TEXT; countries_with_tea TEXT[] := array[‘…
Query to fetch in-out time for all employees from one table
I need to find first in and last out time for all employees from a table. I have tried the following query. This query return the records for a particular employee. But I have to find the data for all employees. Sample Table data: Answer you can use this.