Excel, Tables, CSV + more
SELECT model, shoesize, shoesize*1.42 from ..
operations between one or more columns. The usual operator precedence applies.
SELECT employeeName, sallary+bonus-parkingFee FROM..
SELECT model, shoesize, shoesize*1.42 AS eurosize from ..
SELECT country, gold+silver+bronze AS totalMedals from .. ORDER BY totalMedals
SELECT type,avg(price) FROM 4ab6d05e5139a group by type
SELECT type,count(type) AS products FROM 4ab6d05e5139a GROUP BY type
SELECT type,count(type) AS products,sum(price) AS value FROM 4ab6d05e5139a GROUP BY type
SELECT type,count(type),max(price),min(price) AS cheapest from 4ab6d05e5139a ORDERN by cheapest GROUP BY type
SELECT * FROM 4ab6d05e5139a WHERE price like ^\d{1}\.\d ORDER BY name DESC
SELECT * FROM 4ab6d05e5139a WHERE price BETWEEN 3,10 AND type NOT EQUALS food
SELECT name,price FROM 4ab6d05e5139a WHERE name LIKE ^\w{9,} ORDER BY price
SELECT $1,$2,$4 FROM 4ab6d05e5139a where name like ^b|s$ AND price > 20
SELECT name,$4,sum($2),avg(bonus)...
Foo will match "Foo",
"foo", or "FoO".
name LIKE ckson$ is exchangeable with
name ENDS WITH ckson
EQUALS, EQ, == , =
NOT EQUALS, NEQ, !=, <>
<= , < , >= , >
SELECT name,age FROM .. WHERE age BETWEEN 20,33 both numbers are inclusive.
SELECT nation,bronze+gold+silver AS total FROM ... ORDER BY total DESC
You can use the resulting alias with ORDER BY, as seen above. Avoid using anything other than letters and digits in a alias.
Unless used with '^', '$' or '\b', a regular expression only needs to match some part of the text in order to succeed.
For example, WHERE name LIKE ^Bob$ matches a column containing ONLY Bob,
whereas WHERE name LIKE Bob matches Bob anywhere in the column: Bob, Bobsson, DjBobble, and so on.
c matches the non-metacharacter c.
\c matches the literal character c.
. matches any single character including newline. Alternatives: % or *
^ matches the beginning of a string.
$ matches the end of a string.
[abc...] character set: matches any of the characters abc....
[^abc...] complemented character set: matches any character except abc....
a1|a2 alternation: matches either r1 or r2.
a1a2 concatenation: matches r1, and then r2.
(...) Use parentheses for grouping to concatenate regular expressions
containing the alternation operator, '|'. This regex
WHERE name LIKE ^(P|S) matches all names that begin
with either P or S.
a? a is optional and matched at most once.
a* a will be matched zero or more times.
a+ a will be matched one or more times.
a{n} a is matched exactly n times.
a{n,} a is matched n or more times.
a{,m} a is matched at most m times.
a{n,m} a is matched at least n times, but not more than m times.
\b word boundary: used to perform a "whole words only" search.
Given a name JOE JOHNSON, \bJOHNSON\b matches while \bJOHN\b doesn't.
\d digit: matches a single digit (0, 1, 2, ..9)
\w alphanumeric:matches any word-constituent character (letter, digit, _)
\W matches any character that is not the above.
\s whitespace (space, tab, etc.)
\. matches a literal dot. \\ matches a literal backslash.
| Document | () |
|---|---|
| Type | |
| Size | 0KB (0 bytes) |
| Records (#rows) | 0 |
| Columns pr. record | |
| Column names | |
| Submitted | Dec 31, 1969 @ 16:12 PST |
y (fields, array_keys, # of yrs data) | | |______________ x (records, array_values, # of countries)
Perform quick in-and-out operations (like report generation, data reduction/extraction) on any delimited content or spreadsheet conveniently without fiddling with spreadsheet programs.
Import EXCEL spreadsheets or any delimiter-separated data, such as CSV, HTML, manipulate it quckly with SQL-like querying language and export it to various formats, including spreadsheet and database.
Google: - XML->CSV, HTML->CSV - is_* returns string all the time # FIX THIS optional-> SELECT count(bronze),sum($2) FROM 4aab87af86b0e - ORDERN BY a-column-with-space FAILS. - Excel conventions:no line-breaks inside columns, delete tabs - if conversion goes awry, numrec==-1, show msg, activate import tab - Excel download broken in MSExcel (phpMyAdmin has solution?) - ..WHERE a-colname-with-a-space fails - CSV: replace COMMAs enclosed in quotes to DASHes with SED -i 's/..//g' - MAXDELTA($N),MINDELTA($N),AVGDELTA($N) => different between two adjacent (numeric) values in a column - use flash SharedObjects to remember documents accessed by user - AWK BROKEN - FIELDSEP values enclosed within double-quote characters not ignored - Google spreadsheets must be CCC licenced or in the public domain (http://spreadsheets.google.com/ccc and http://spreadsheets.google.com/pub, respectively) - security concern: move the cache dir to output server_root - VERSION2 - Subqueries: SELECT name,sallary,age from 4aafa669bd5cb where age == (select max(age) from 4aafa669bd5cb) - group by $5,$6 - count(title,date) -> count[$1,$4]=$1,SUBSEP,$4..... end for loop -> n = split(item,arr,SUBSEP); - WHEN "Unknown field name", hilite the string within the textarea - autocomplete on textarea (jQuery) - Interactive mode with jQueryUI: drag and drop, group rules into boxes (AND/OR couples)