Questions tagged [query]

196 questions
0
votes
1 answer

MS SQL Query Sum of subquery

I need a help i getting following output from the query . SELECT ARG_CONSUMER, cast(ARG_TOTALAMT as float)/100 AS 'Total', (SELECT SUM(cast(DAMT as float))/100 FROM DEBT WHERE DDATE >= ARG.ARG_ORIGDATE AND DDATE <=…
San
  • 543
  • 4
  • 6
0
votes
1 answer

How to search MySQL table for duplicates

In MySQL, I have a table named "city" with "city_name" and "latitude" and "longitude" in it. It appears that I have a few duplicates. What query can I run (in phpmyadmin) that will search through the "city" table for entries containing the same…
Micky_mike
  • 23
  • 3
0
votes
1 answer

MS SQL Query Count & Sum

select count(distinct consumerno), sum (case when ccon like '%D%' then 1 else 0 end) as Domestic, sum (case when ccon like '%B%' then 1 else 0 end) as Business from consumer left join contract on consumerno = cconsumer where status =…
San
  • 543
  • 4
  • 6
0
votes
2 answers

How to rewrite query strings in url (\img?src=foo.jpg) into cachable urls (\img-foo.jpg)?

a question that is now partially resolved. A genius who can speak Apache fluently can shine light into this matter... GIVEN: Most proxies, do not cache resources with a "?" in their URL even if a Cache-control: public header is present in the…
Sam
  • 423
  • 3
  • 7
  • 23
0
votes
2 answers

Is there a way to find out the detailed statistics of the querys that processed by Mysql?

The load average of my service is high, always around 15. And the reason for that is the Mysql is overloaded. I'm wondering How Can I find out which specific query/script consume the most Mysql resources? Thanks.
David Liu
  • 323
  • 1
  • 3
  • 6
0
votes
1 answer

Putting indexes in separate filegroup kills our queries

Can anyone shed some light on this? On our dev boxes, our database resides entirely in the PRIMARY filegroup, and everything works fine. On one of our production servers, recently upgraded from 2005 to 2008, we noticed it was performing slower than…
womp
  • 133
  • 7
0
votes
2 answers

MySQL stop responsing when modify main tables

It's an InnoDB database. The query cache has 1.2GB in size with 300k queries in the cache. Most of the cached queries are related to 3 major tables (260MB data length plus 600MB index length altogether). Everytime I tried to insert new entry or…
jack
  • 1,725
  • 5
  • 21
  • 25
0
votes
2 answers

MySQL server has gone away occasionally on simple select query

For many weeks I have had a problem with a simple SQL query where from time to time the MySQL server has crashed. But recently it is crashing every day, 1-2 times a day. The query is very simple: SELECT ... from table where field = 'some string'…
Nik
0
votes
1 answer

MySQL 5.1 Slow SHOW DATABASES (phpMyAdmin)

We have about 200 databases and since upgrading from 4.1 to 5.1 we've noticed that PHPMyAdmin takes a while to load the left navigation sometimes. Is there anything we can do to make this quicker? Thanks!
Kristopher Ives
  • 384
  • 1
  • 3
  • 14
0
votes
1 answer

SQL Query fields change to uppercase on upload to server

I have just finished developing an app using CodeIgniter. When I upload it to my Host (Hostgator shared) some of the SQL text is converted to uppercase and rendering the app unusable. In my database I have two tables client and transaction. When I…
jim
  • 183
  • 1
  • 7
0
votes
0 answers

Which is the correct capability in Courier SMTP config to get user's password (encryption type)

MySql: 8.0.34-0ubuntu0.22.04.1 I have followed this guide: Postfix With Courier IMAP Mail Server Installation (unfortunately they do not answer questions). I had to change the encryption method for the user's password because the one recommended in…
0
votes
1 answer

AWS CLI : How to use "--query" to get output from nested JSON

I am using aws-cli v2 to get the --query output from AWS Describe-volumes. In this, I am trying to get the volume id, size, Instance ID, state. Instance ID is nested in the AWS Describe-volumes. Source : { "Volumes": [ { …
0
votes
0 answers

Prometheus query to identify active series if a datapoint is sent in the last 15-30mins

I am trying to identify my Prometheus active series if a datapoint is sent in the last 15-30mins. As I understand it, this query prometheus_tsdb_head_series gives me active series if a datapoint is sent in the last 1-3 hours. Can anyone help with…
qu_001
  • 1
0
votes
1 answer

GCP- Alert for adding new user or service account to a project

I want to create an alert in my project in GCP that lets me know when a new user or service account is added to the project. I understand I need to use Logs Explorer and run a query but I am not sure what query to run. Thanks!
0
votes
1 answer

Why my simple searching query is too slow?

I don't know why searching in my "cities" table is so slow. My query looking for a table "cities" located about 25km from the city. I use this simple query and the database takes almost 20 seconds to return results. SELECT city_destination,distance…
Sahasrar
  • 3
  • 1
  • 3