I've got two postgresql tables: table name column names ----------- ------------------------ login_log ip | etc. ip_location ip | location | hostname | etc. I want to get every IP ...
I'm trying to find out if a row exists in a table. Using MySQL, is it better to do a query like this: SELECT COUNT(*) AS total FROM table1 WHERE ... and check to see if the total is non-zero or is ...
I'm curious which of the following below would be more efficient? I've always been a bit cautious about using IN because I believe SQL Server turns the result set into a big IF statement. For a large ...
How can I check if any of the strings in an array exists in another string? Like: a = ['a', 'b', 'c'] str = "a123" if a in str: print "some of the strings found in str" else: print "no strings f...
I've found a few "would be" solutions for the classic "How do I insert a new record or update one if it already exists" but I cannot get any of them to work in SQLite. I have a table defined as follo...
How do you test an element for existence without the use of the getElementById method? I have setup a live demo for reference. I will also print the code on here as well: <!DOCTYPE html> <ht...
Is it possible to check if a (MySQL) database exists after having made a connection. I know how to check if a table exists in a DB, but I need to check if the DB exists. If not I have to call another...
I did change the datadir of a MySQL installation and following some steps it worked fine. Every base I had was moved correctly but one. I can connect and USE the database, even SHOW TABLES returns me...
What I'm trying to do is INSERT subscribers in my database, but IF EXISTS it should UPDATE the row, ELSE INSERT INTO a new row. Ofcourse I connect to the database first and GET the $name, $email and ...
What is the best way to check if an object exists in the database from a performance point of view? I'm using Entity Framework 1.0 (ASP.NET 3.5 SP1).