Time incarcerated

210
May 02, 2017, at 07:53 AM

trying to write a query for spent more time incarcerated than not sorted from highest to lowest percentage (as decimal value in range of 0.0 to 1.0 [or more]) of life spent incarcerated. With the output name, city, age, years_incar, pct_incar, and pct_out. Where age is the number of years (as a floating-point number), pct_incar is percentage (as floating-point value in range of 0.0 to 1.0) of life spent incarcerated, and pct_out (as a floating-point value in range of 0.0 to 1.0) of the percent of life spent not being incarcerated.

create table data ( id integer primary key, pct decimal(5, 2) not null check (pct > 0 and pct <= 100) );

Answer 1

Try this:

SELECT * 
FROM table 
WHERE latitude BETWEEN 34.0522 AND 37.0454 
AND longitude BETWEEN -118.2436 AND -116.4378 
AND lower(city) like 'cali%';

This will cover cali, california and CALIFORNIA.

READ ALSO
Nested CASE expressions

Nested CASE expressions

I am writing a case where all the outputs should be showed for inactive users receipts pending in review

189
How can I select a table that have 2 part name(Mysql?

How can I select a table that have 2 part name(Mysql?

I know this question is a little stupidBut I will appreciate to answer it, I have a table, The table have 2 part name

110
#1093 - Table is specified twice, both as a target for &#39;UPDATE&#39; and as a separate source for data

#1093 - Table is specified twice, both as a target for 'UPDATE' and as a separate source for data

I tried to update a field with multiplication and it shows error #1093 - Table is specified twice, both as a target for 'UPDATE' and as a separate source for data

541
docker phpmyadmin cant access localhost

docker phpmyadmin cant access localhost

I try to create a phpmyadmin docker, the command executed successfully but when i access to localhost:8080 it freezes and nothing appears

348