Skip to content

Tag: sql

Clarification of Java/SQLite batch and auto-commit

I copied the following example from an SQLite Java library website: I’m struggling to understand the significance of toggling autoCommit() either side of executeBatch(). Does it merely prevent a commit being made for each individual batch operation? Thus a single ‘bulk’ commit is will be mad…

See whether an item appears more than once in a database column

I want to check if a piece of data appears more than once in a particular column in my table using SQL. Here is my SQL code of what I have so far: salesid is the column I wish to check for, any help would be appreciated, thanks. Answer It should be: Regarding your initial query: You cannot do a

Remove duplicate data in ‘date-ranged’ rows

I have a table like the following. The date range is used to know for what time period the rest of the Attributes were valid, the problem i have is that there are several consecutive time ranges where the Attributes ramain the same, what I would like is to obtain the same data but without the duplicate rows. …

0 rows inserted – How can I fix this?

I an trying to INSERT multiple rows into an SQL, Oracle table though SQL Developer v3.0.04 the Database was set-up by Uni so I don’t know what version it is. after looking on-line I have come up with the code below but it will not INSERT any data. I have tested the insert with just one row and that is

MySQL comparison with null value

I have a column called CODE in a MySQL table which can be NULL. Say I have some rows with CODE=’C’ which I want to ignore in my select result set. I can have either CODE=NULL or CODE!=’C’ in my result …

creating a temporary table from a query using sqlalchemy orm

I can create a temporary table this way: but the new table is unreadable because it says it has no primary key. existingtable.id is the primary key of exisitingtable, so I expected it to get the same treatment in the temp table. However, I would rather find some ORM way of doing this anyway. Given: How can I …