Skip to content

Tag: sql

How to get the last row of an Oracle a table

I want to get the last row, which I inserted into a table in an Oracle 11g Express database. How can I do this? Answer There is no such thing as the “last” row in a table, as an Oracle table has no concept of order. However, assuming that you wanted to find the last inserted primary key and that

How to separate DATE and TIME from DATETIME in MySQL?

I am storing a DATETIME field in a table. Each value looks something like this: 2012-09-09 06:57:12 I am using this syntax: Now my question is, while fetching the data, how can get both date and time separately, using a single MySQL query? Date like “2012-09-09” and time like “06:57:12&#8221…

Using a SQL source file with the bigquery cli

Is it possible to use an input file with the bigquery CLI? Answer If you’re using unix (or have cygwin installed on windows), you can use xargs: Alternately you can use back-ticks: Note that bq can only process one command at a time — if your .sql script has several queries, you’ll need to s…

SQLite over LAN

my application uses SQLite database for it’s data storage. Idelly, this database should reside on some network drive, let’s name it Z: (Windows XP’s “Map network drive” feature). Application is being developed under Linux, with database locally stored. Here is a part of one modul…