Select rows which are not present in other table

Select rows which are not present in other table

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 address from login_log which doesn't have a row

How can I fix MySQL error #1064?

How can I fix MySQL error #1064?

When issuing a command to MySQL, I'm getting error #1064 "syntax error".What does it mean?How can I fix it? 1: TL;DR Error #1064 means that MySQL can't understand your command. To fix it: Read the error message. It tells you e

How do I discover memory usage of my application in Android?

How do I discover memory usage of my application in Android?

How can I find the memory used on my Android application, programmatically?I hope there is a way to do it. Plus, how do I get the free memory of the phone too? 1:Note that memory usage on modern operating systems like Linux is an extreme

Improve INSERT-per-second performance of SQLite?

Improve INSERT-per-second performance of SQLite?

Optimizing SQLite is tricky. Bulk-insert performance of a C application can vary from 85 inserts per second to over 96,000 inserts per second!Background: We are using SQLite as part of a desktop application. We have large amounts of configu

How to send an object from one Android Activity to another using Intents?

How to send an object from one Android Activity to another using Intents?

How can I pass an object of a custom type from one Activity to another using the putExtra() method of the class Intent? 1:If you're just passing objects around then Parcelable was designed for this. It requires a little more effort to us

How to concatenate text from multiple rows into a single text string in SQL server?

How to concatenate text from multiple rows into a single text string in SQL server?

Consider a database table holding names, with three rows:PeterPaulMaryIs there an easy way to turn this into a single string of Peter, Paul, Mary? 1:I had a similar issue when I was trying to join two tables with one-to-many relationship

How can I count unique pairs of values in SQL?

How can I count unique pairs of values in SQL?

With the following sql statement I can get all unique values with their counts for a given column:select column, count(column) as count from table group by column order by count desc;How would I get all unique pairs of values with

Is there a sql editor powered by HTML + css + javascript? [closed]

Is there a sql editor powered by HTML + css + javascript? [closed]

syntax highlighting + sql code format 1:Code Mirror will do the trick. It's really nice. Very easy to run any code that you enter into it using editor.getValue(). 2:You could try http://www.dpriver.com/pp/sqlformat.htmIt doesn't forma

Rails database boolean values

Rails database boolean values

Code first:create_table :users do |t| ... t.boolean :is_active, :default => true ...endNow, here is my issue - I am creating a rake task to import a LARGE number of records (10,000+). I've done extensive testing and benchmarking and dete

What's the R equivalent of SQL's LIKE 'description%' statement?

What's the R equivalent of SQL's LIKE 'description%' statement?

Not sure how else to ask this but, I want to search for a term within several string elements. Here's what my code looks like (but wrong):inplay = vector(length=nrow(des))for (ii in 1:nrow(des)) { if (des[ii] = 'In play%') inplay[ii] = 1 e

Auto TimeStamp new entry to DB (phpMyAdmin)

Auto TimeStamp new entry to DB (phpMyAdmin)

If I want each new entry into my db to be automatically timestamped, would I set the Field Type to "timestamp" and have the Default value set to "CURRENT_TIMESTAMP"?Is this the correct method? 1:That is correct. In SQL code that would be

A custom ostream

A custom ostream

I need some guidance or pointers understanding how to implement a custom ostream. My requirements are:A class with a 'First, does it worth deriving from ostream? What do I get by deriving from ostream? What if my class simply implements few

Updating multiple rows Linq vs SQL

Updating multiple rows Linq vs SQL

Some time ago I wrote a piece of code to update multiple rows in a database table. The code was like thisvar db = new MyDataContext();db.Execute("UPDATE Details SET IsActive = 0 WHERE MasterId = 1");Then the other day when I got the latest

Entity framework Include command - Left or inner join?

Entity framework Include command - Left or inner join?

As I was investigating the difference between Include and Join I found that : If the DB does not include a Foreign Keys -it has no navigation props so it's better to use JoinIf It does have a navigation props - then use Include. ( it also

Why does PostgreSQL not return null values when the condition is  true

Why does PostgreSQL not return null values when the condition is true

I was confused behind the reasoning of the following:SELECT * FROM table WHERE avalue is nullReturns x number of rows where 'avalue' is nullSELECT * FROM table WHERE avalue trueDoes not return rows where 'avalue' is null. My reasoning (whi

“SELECT VALUE” - value keyword in LINQ/Entity Framework query

“SELECT VALUE” - value keyword in LINQ/Entity Framework query

What does the keyword "value" mean in this statement, and where would I go to learn more?What happens if I leave out the keyword "value"? In the code below, z is an entity framework class. string queryString = "SELECT VALUE q from x.zs as q

SELECT ONE Row with the MAX() value on a column

SELECT ONE Row with the MAX() value on a column

I have a pretty simple dataset of monthly newsletters:id | Name | PublishDate | IsActive1 | Newsletter 1 | 10/15/2012 | 12 | Newsletter 2 | 11/06/2012 | 1 3 | Newsletter 3 | 12/15/2012 | 04 | Ne

Laravel Eloquent inner join with multiple conditions

Laravel Eloquent inner join with multiple conditions

I have a question about inner joins with multiple on values.I did build my code like this in laravel.public function scopeShops($query) { return $query->join('kg_shops', function($join) { $join->on('kg_shops.id', '=', 'kg_feeds

Database project deploy fails in Visual Studio 2013

Database project deploy fails in Visual Studio 2013

I have a database project in a solution which will not deploy from Visual Studio 2013. It fails with an error message "Unable to connect to target server". The same project, when opened in Visual Studio 2012 deploys without an issue.The dat

Convert strings to UPPERCASE in SQL Server

Convert strings to UPPERCASE in SQL Server

What is the T-SQL function for converting strings into upper case in SQL Server? 1:UPPERSELECT UPPER(LastName) + ', ' + FirstName AS NameFROM Person.Person 2:Query: select UPPER('Hello world!!!')Result: HELLO WORLD!!!

How do I query for fields containing a given text in MySQL?

How do I query for fields containing a given text in MySQL?

SELECT stuff REGEXP 'itunes' as is_itunes;In this MySQL query, if "stuff" has the word "itunes" in it, it will mark it as itunes.However, I want to say "begin with". How can I check for "begin with" instead of anywhere in the text? 1:SEL

MySQL group by date and convert from unix timestamp

MySQL group by date and convert from unix timestamp

I have the following sql table (simplified)ID (int) title (text) date (int)--------------------------------------------1 Hello World 13781489202 Hello World2 13781821833 Hello World

Why do I need two SQL Server Service Broker queues for a simple task?

Why do I need two SQL Server Service Broker queues for a simple task?

All examples I find on the web for using SQL Server Service Broker queues seem to have two queues. I don't understand why and every example seems to assume that this is so obvious as to be unnecessary to explain.Several things will write to

Multiple DbContexts on one DB with Code First Migrations

Multiple DbContexts on one DB with Code First Migrations

I stumbled uppon the same problem as described in this question. In addition, i didn't want to loose the __migrationHistory table from the database.I tried it with the suggested Solution of using one "super" context which contains all DbSet

How to add job with trigger for running Quartz.Net scheduler instance without restarting server?

How to add job with trigger for running Quartz.Net scheduler instance without restarting server?

Is it possible to add job with trigger for running Quartz.NET scheduler instance without restarting server? 1:A fairly robust implementation with ADOJobStore is to have a custom table to store jobs and create a class that inherits from I