My Filter
   28 tags on

My Filter

  • All Sites
  • Arqade

1 answer

How to merge several records in one using COALESCE in MS SQL 2008

I'm guering three tables from the DataBase with the idea to extract information for a certain Client so I get single values from all columns except one. My tables are : Client :: (ClientId | ...

2 answers

App.Config Connection String

In my windows form i have connection string in app.config as <configuration> <configSections> </configSections> <connectionStrings> <add ...

2 answers

What could cause very slow performance of single UPDATEs of a InnoDB table?

I have a table in my web app for storing session data. It's performing badly, and I can't figure out why. Slow query log shows updating a row takes anything from 6 to 60 seconds. CREATE TABLE ...

2 answers | 3 mins ago by drewm on Stack Overflow
0 answers

SQL subquery with average of 3 top values in Postgresql

I need a little help to solve a query to count patients (ID) who have the average of the 3 last diastolic tension (TAD) < 90. I've tried several type of nested subqueries with differents errors. …

1 answer

Remove not found word from mySQL query

I am trying to make search and need to remove word from query, that do not have match. Lets say there is 3 words: one, two and three. If one is not found, then I need to rerun query with other two ...

1 answers | 3 mins ago by Bambarbia on Stack Overflow
0 answers

TSQL: How do I calculate total minutes between start and end times?

How do I calculate total minutes between start and end times? The Start/End times columns are nvarchar and I am declaring them as datetime. I'm not sure if that is my first step or not, I am new to …

1 answer

Show unique value for id, based on latest createby date

I am using the following SQL code to JOIN a few tables, but need to show unique values for the s.incidentid based on the latest s.createdate. I know I need to use a Sub query with Maxdate, but I am …

0 answers

How to add mssql server in networks list?

I was change my PC name and workgroup & I guess after this my ms sql server isnt connecting. I'm using MS SQL 2012. Currently in my servers list I have only Home & localhost. Anybody know how …

0 answers

Duvida em select de sql

Então ... Eu tenho uma tabela que tem uma sequenc um num uma dt_inicial e uma dt_final. Minha duvida é .. Como fazer um Select que pegue os dados entre a dt_inicial e dt_final mostrando os num entre …

3 answers

Select records that are only associated with a record in another table

Not sure if the title explains this scenario in full, so I will be as descriptive as I can. I'm using a SQL Server database and have the following 4 tables: CUSTOMERS: CustomerID CustomerName ...

3 answers | 6 mins ago by user3699343 on Stack Overflow
2 answers

How to write this sql server query

I have three tables employeemaster, roles, employeeroles as shown here: employeemaster table: id name isactive ------------------- 1 nixon 1 2 jane 1 3 …

2 answers | 6 mins ago by nichu09 on Stack Overflow
0 answers

SQLServer2008: Use bcp in to import .csv file that has commas within some of the columns

I have a table in SQL into which I would like to import some .csv files (all of the same format). I'd like to use bcp rather than the import/export wizard so that I can automate the process. The ...

1 answer

make IN clause to behave like AND clause

I've asked the same question on stackoverlow, but got no answer, so that's why I'm asking it here (i've read that simple sql questions should be asked at SO, but I have no choice). Suppose I have 3 …

1 answers | 8 mins ago by Dima Knivets on Database Administrators
1 answer

MYSQL Using Spatial Index

I am attempting to utilize the spatial index. I have a table of ips, and a ip2geo table with ip block ranges. I'm attempting to assign Geo ID to each ip from the ip2geo table When attempting to to …

0 answers

Converting a Microsoft access SQL query using Ccur to SQL Server

Trying to convert this SQL statement from Microsoft access to SQL server. I understand that SQL Server doesnt use Ccur do they use CONVERT instead? SELECT Ccur(Choose(IIF(IsNull(SCStatus),1 ...

2 answers

Find unique sets in sql data

I have three tables: Modules | ID | name | Subscription | module_id | user_id | ... User | ID | user_name | I need a list of unique subscription sets. (ie. x users subscribed to modules (1), y …

2 answers | 10 mins ago by Chainlink on Stack Overflow
3 answers

Cannot insert the value “Null” into column 'xyz'

I'm having an issue with adding new patients to my SQL database. When I do so, the following error appears, and an SQL Exception is thrown. Cannot insert the value NULL into column 'ID', table ...

3 answers | 11 mins ago by Paul Shalley on Stack Overflow
1 answer

SQL Server : Dynamic Pivot

I have found many articles on dynamic pivots, selecting the data first and then running a 2nd query to do the pivot, however I have a large query that I require a dynamic pivot and am not sure how to …

1 answer

Inner join with conditional sum

So I have 3 tables, where i need to get the sum of the price column grouped by the day_of_week column, and only return the sum for the day_of_week, that has the lowest sum. In other words, all the …

1 answers | 13 mins ago by cbojer on Stack Overflow
1 answer

Restoring corrupt database - “mdf is not a primary database file”

Unfortunately the hard disk of my system is damaged. I am trying to recover my database, but it cannot be attached again to SQL management studio 2005. The error is myfile.mdf is not a primary ...

0 answers

android to mssql 2008 not connecting

this is my package com.example.sqlserver2008droid; import java.sql.*; import android.R.string; import android.webkit.WebView.FindListener; import android.widget.EditText; ...

1 answer

JdbcTemplate SELECT … FOR UPDATE - no lock

I am using JdbcTemplate from Spring framework. The database is Oracle. Simplified Code: void m() { setAutocommit(false); // the same result with/without this line (by default: true ) ...

1 answer

how to resolve mssqlsystemresource.mdf corruption?

Desperate for help, but fearing the worst here :( Something crashed SQLSERVER 2005 this afternoon approx 3pm. Since then I have been trying to get running again. Original log file messages told that …

0 answers

Adding Constraint on Table for ON Delete Cascade

I am still new to MySQL and I need help for this. I have 2 tables, the first 1 is the School and the other 1 is Course. How can I delete all the courses for that particular school if I am going to …

1 answer

updating per category in T-SQL

I have a table like this: id | ImportDate | ExpirationDate 1 | 2014-08-21 | 2014-08-21 1 | 2014-08-19 | 2014-08-20 2 | 2014-08-20 | 2014-08-20 2 | 2014-08-19 | 2014-08-19 Now I want to ...

1 answers | 26 mins ago by arth81 on Stack Overflow
4 answers

How to get latest records from database sorted by id and status

I have table with these columns: id, status, text. my sql query: SELECT * FROM table ORDER BY id AND status DESC I need to get all rows from table and sort it by id and by status descending. result …

4 answers | 29 mins ago by qwerty on Stack Overflow
0 answers

SAS Dynamic SQL join

I want to join 6 tables, which all have different variables, to one table, which has same columns as all 6 other tables. Can i somehow do it without looking at these tables and watching which columns …

1 answer

I cant able to edit my column name after saving

i create a new table of employee now i want to edit one of the column name in that table .i can able to edit but while saving a pop up window is coming.and asking to save some text may i ...

1 answer

Finding unique data grids in sql

I want to find unique data sets using sql (think groups of rows that form unique data sets, find and eliminate duplicates). Grouping is to be done on parent_id, key_id, key_value_id. But uniqueness …

1 answers | 34 mins ago by Anju Singhal on Stack Overflow
3 answers

How to fix datetime form between c# and SQL Server in different computers

I create applications for my customers and I usually get a DateTime conversion problem when application is deployed to other computers. In Winforms, I have date selector control for users. A user ...

3 answers | 35 mins ago by ayilmaz on Stack Overflow
15 30 50 per page
1 2 3