Sponsored Content
Full Discussion: SQL: copying data down
Top Forums Programming SQL: copying data down Post 302577706 by radoulov on Tuesday 29th of November 2011 05:40:26 PM
Old 11-29-2011
Code:
mysql> select
    ->   date,
    ->   temp,
    ->   case
    ->     when delta > 0 && @d := delta then delta
    ->     else @d
    ->   end as delta
    -> from
    ->   temperatures
    -> order by
    -> date;
+------+--------+-------+
| date | temp   | delta |
+------+--------+-------+
| 1977 | 284.54 | 29.84 |
| 1978 | 149.82 | 29.84 |
| 1979 | 320.71 | 28.45 |
| 1980 | 176.76 | 28.45 |
| 1981 | 854.65 | 28.45 |
| 1984 | 817.65 | 28.45 |
| 1985 | 990.58 | 27.98 |
| 1986 | 410.21 | 27.98 |
| 1987 | 405.93 | 27.98 |
| 1988 |  482.9 | 27.98 |
| 1991 | 269.02 | 27.98 |
+------+--------+-------+
11 rows in set (0.00 sec)

These 3 Users Gave Thanks to radoulov For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

copying data to raw devices using 'dd'

Hello all, I'm new here, so this information may exist elsewhere on this forum. If so, please point me in the right direction. Here's the problem. I'm trying to migrate Oracle data from an HP system to a Sun system using a raw device as a 'bridge' between the two systems. Both machines... (4 Replies)
Discussion started by: Neville
4 Replies

2. Shell Programming and Scripting

Compress the contents of a directory while copying data into it

Hi guys I have a need to compress the contents of a directory while I am copying data into it. I was able to do this when it was only one file by doing as below: STEP1: mknod myfile p STEP2: chmod 777 myfile STEP3: compress -v < myfile > myfile.Z & STEP4: cp -p xyz_file myfile... (2 Replies)
Discussion started by: user1602
2 Replies

3. Shell Programming and Scripting

Copying data from excel file

Hii friends, I am a newbie to unix/shell scripting and got stuck in implementing a functionality.Dear experts,kindly spare some time to bring me out of dark pit :confused:.. My requirement is somewhat wierd,let me explain what i have and what i need to do... 1) there are several excel... (1 Reply)
Discussion started by: 5ahen
1 Replies

4. Shell Programming and Scripting

How to use sql data file in unix csv file as input to an sql query from shell

Hi , I used the below script to get the sql data into csv file using unix scripting. I m getting the output into an output file but the output file is not displayed in a separe columns . #!/bin/ksh export FILE_PATH=/maav/home/xyz/abc/ rm $FILE_PATH/sample.csv sqlplus -s... (2 Replies)
Discussion started by: Nareshp
2 Replies

5. Programming

Doubt in C programming (copying data from one file to another)

Hello, i'm new to the forum and so am i to C programming. Recently i've gotten a task to create a program that will read an existing .bin file and copy the data to a non existing (so i have to create it) .txt file (some type of conversion) Now, i now how to put the arguments, opening and... (5 Replies)
Discussion started by: Lyric
5 Replies

6. Shell Programming and Scripting

Copying data from files to directories

I have the following that I'd like to do: 1. I have split a file into separate files that I placed into the /tmp directory. These files are named F1 F2 F3 F4. 2. In addition, I have several directories which are alphabetized as dira dirb dirc dird. 3. I'd like to be able to copy F1 F2 F3 F4... (2 Replies)
Discussion started by: newbie2010
2 Replies

7. Solaris

Copying data from one file server to another

Hello people, I have a question regarding transferring data from one file server to another. The server is a Solaris 9 box The old file server is connected via Ethernet cable, and the new file server we are switching is a Fiber channel. can I use the dd if=server:/app1 of=server2:/app1 ... (2 Replies)
Discussion started by: br1an
2 Replies

8. UNIX for Dummies Questions & Answers

Copying part of a data file into another

Hi, I have a large number of data files each containing simple integers from 1 to around 25000 in ascending order. However, they are not in a specific progression; some numbers are missing in each file. For ex. datfile1 may have the numbers in order 1 2 4 6 7 8 12 ... 24996 24999 while datfile2... (8 Replies)
Discussion started by: latsyrc
8 Replies

9. Red Hat

Copying data from USB CD Drive.

I need to perform operation as captioned. I found out USB CD Drive is attached, by running 'lsusb' command. I am trying to identify mechanism by which I could mount this USB CD drive to disk. After which I expect to copy the contents. Could anyone indicate how this could be performed ? (3 Replies)
Discussion started by: videsh77
3 Replies

10. Programming

SQL: copying data up

I need to fix an SQL statement in MySQL that should calculate a field using values from two of the columns and I prefer to do this using set-based programming, ie not procedural. What needs to happen is that in a separate column called "delta" the value of "level" is copied depending on whether... (3 Replies)
Discussion started by: figaro
3 Replies
cldump(1)							   User Manuals 							 cldump(1)

NAME
cldump - Clarion database extractor SYNOPSIS
cldump [options] database.dat DESCRIPTION
cldump extracts the data contained in a Clarion database; Clarion is a Windows IDE similar to Delphi or others, and has its own (simple) database format. cldump can extract the data contained in such a database, and export it to CSV, SQL (including the database schema, keys and indexes) or its own format (this format will give you all the meta information, but isn't easily parsable). A Clarion database consists in a set of files : .DAT files contain the data, .Kxx files contain the key/index data, .MEM files contain the memo entries associated to the data. OPTIONS
-x n, --decrypt n Decrypt an encrypted file. Required argument n indicates the location where the key will be retrieved. Valid values are in the range 1 - 4 inclusive. n = 1 usually works. Decryption happens in-place so KEEP A BACKUP as there is no guarantee the decryption process won't fail. Encrypted files must be decrypted before they can be dumped. Note that only the data file and the memo file are decrypted in this process; key/index files are left untouched as cldump doesn't use them. -d, --dump-active Dump active entries only -D, --dump-data Dump the actual data (active and deleted entries) -m, --dump-meta Dump meta information (no SQL or CSV output format exist for this option) -f c, --field-separator c Set the field separator to character c. Only valid for CSV output (see below). -c, --csv Dump data or schema in CSV format -S, --sql Dump data or schema in SQL format -s, --schema Dump database schema -M, --mysql Use MySQL specific construct (backticks, ...) -n, --no-memo Do not dump memo entries -U[charset], --utf8[=charset] Transcode strings and memos from charset to UTF-8 (charset defaults to ISO8859-1; for the list of supported charsets, see iconv --list) OUTPUT
cldump outputs the data to stdout or stderr depending on the output format selected, the data to extract and the type of the data (data, meta data). BUGS
The SQL output could be improved. Not all the types supported by the Clarion database format are implemented yet (due to lack of test data- bases using these types of data); see the source code for details. Please report bugs to jb@jblache.org; if possible, please send patches as the set of test databases I have is very limited. AUTHOR
cldump was written by Julien BLACHE <jb@jblache.org>. HOMEPAGE
http://www.technologeek.org/projects/cldump/ Linux November 2010 cldump(1)
All times are GMT -4. The time now is 04:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy