[sqlite] Can this be sorted?

2015-02-15 Thread Bart Smissaert
Have the following full SQL:

SELECT
DS.DRUG_NAME AS DRUG_NAME,
SUM(INSTR(M.ASSOCIATED_TEXT, DS.SENSITIVE_STRING) > 0) AS SENSITIVE,
SUM(INSTR(M.ASSOCIATED_TEXT, DS.RESISTANT_STRING) > 0) AS RESISTANT,
ROUND(TOTAL(INSTR(M.ASSOCIATED_TEXT, DS.SENSITIVE_STRING) > 0) /
(TOTAL(INSTR(M.ASSOCIATED_TEXT, DS.SENSITIVE_STRING) > 0) +
TOTAL(INSTR(M.ASSOCIATED_TEXT, DS.RESISTANT_STRING) > 0)), 2) AS RATIO
FROM DRUG_SENSITIVITY_STRINGS DS
JOIN MSU M
WHERE M.ASSOCIATED_TEXT LIKE '%Nitrofurantoin. R%'
GROUP BY DS.DRUG_NAME
ORDER BY RATIO DESC, RESISTANT ASC

Result is shown below.

No matter whether I do RESISTANT ASC or RESISTANT DESC
I can't get Nitrofurantoin at the bottom where I would like it to be.
How can I do this?

RBS

 *Drug**Sensitive*
*Resistant**Ratio*Ertapenem 10201Meropenem301Pip/Tazobactam301
Cefalexin/Cefdrxl4070.85Gentamicin310.75CiprofloxacinS1570.68Amoxicillin2115
0.58Ampicillin760.54Trimethoprim18290.38Amoxyclavulanate6130.32
Nitrofurantoin0470Cefixime000Erythromycin000Fluclox(Met/Ox)000Penicillin000
Tetracycline00

0


[sqlite] Can this be sorted?

2015-02-15 Thread Igor Tandetnik
On 2/15/2015 6:54 PM, Bart Smissaert wrote:
> Result is shown below.
>
>   *Drug**Sensitive*
> *Resistant**Ratio*Ertapenem 10201Meropenem301Pip/Tazobactam301
> Cefalexin/Cefdrxl4070.85Gentamicin310.75CiprofloxacinS1570.68Amoxicillin2115
> 0.58Ampicillin760.54Trimethoprim18290.38Amoxyclavulanate6130.32
> Nitrofurantoin0470Cefixime000Erythromycin000Fluclox(Met/Ox)000Penicillin000
> Tetracycline00

This is illegible.



[sqlite] System.Data.SQLite and spellfix under VB.net

2015-02-15 Thread sonypsx
Hello,

could some please post a sample how to use the spellfix module with
System.Data.SQLite under VB.net?
If i try to create the required table as documented here:

http://www.sqlite.org/spellfix1.html

I end up with an error:  "SQL logic error or missing database no such
module: spellfix1"

I'm already working fine with the FullText Extensions:
http://www.sqlite.org/fts3.html
So I'm curious how to do spellfix e.g. Levenshtein in SQLite.

Thanks in advance
sonypsx