Skip to content

Tag: sql

sql runs fast in ssms slow in asp.net

I have been having this problem for a couple of weeks now. The problem is that the query takes 4-5 minutes to run on the website and at most 2 or 3 seconds to run in ssms. Also I found that after I make a change to this query like adding the customerId variable it will start running quickly on

Rails Nested SQL Queries

I have a database model Position(lat,lon) which holds latitudes and longitudes. I have a controller action called show_close_by which recieves a position in degrees (my_lat, my_lon), a tolerance (in …

How to write an “exclusive” query in SQL?

I am going over a past paper for a database course I am taking and I am stuck on an SQL question Here is the schema provided Country(name, capital, area), name is the key People(country, population, children, adult) where country refers to the name in Country, population is the total population, and children …

How to sort values in columns and update table?

I’m completely new to sql and can’t do that myself. So I need your help. I want to sort values in column and then save changes. But I don’t know how to do that. Table looks like that: Id | Name | …

Mysql queries giving error after upgrading

why this simple query not working. I know it was OK before I upgraded my mysql version. i know there are some syntax changes in new version that I done. but this is simple query no join, but not working. Please help me. EDIT: Upgraded from mysql4 to mysql5 and error is ‘syntax error’ Answer I thin…