I need to write a query in SQL that will get the fifth-from-last record from my database when either a primary key is defined or no primary at all is defined. How would this query look?
Is it possible to write a query that goes through the entire database to search out a particular phrase to delete it, instead of going table by table? This is on a SQL 2005 Database that was injected. The following appears throughout the database tables: <script...
Hi, I am Software Engineer, I am using SQL-SERVER, I have a issue with it. I want to write a query to dynamically create a table when using BULK Insert. No of Column is dependent upon no of fields available in first row. Assume that in each row no of column is same.Column name can be any string,...
See query: select distinct f2.description Business_Unit, f3.description Department, f4.description Function, a.segment5 Account, f5.description Account_Description, sum(nvl(d.entered_dr,0) - nvl(d.entered_cr,0)) Actual, (Select...
In my script (that is not working yet) I want to make sure if "full_value" (a field) is empty in a particular record then the value zero will be inserted. This is working in Access, but I'm trying to rebuild the query in SQL. Thank you. SELECT DISTINCT oas_balance.cmpcode, oas_balance.el1,...
I have data in a table on a SQL Server 2005, and I need to query this table and save the results in a XML file that conforms to a given XSD. Is there an easy way of doing this?
Find the employees who earn a salary greater than the average salary for their departments using a SQL query
I have a table called "ticketing" and I want to bring from that table the record with the most current date. What kind of query should I write in SQL Server 2005 to bring up that result?
Is there any function in MySQL that can create a query similar to crosstab query in MS Access???
It appears that my queries of stored procedures, tables, columns, etc. are case sensitive in SQL Server 2005. Is there a “case sensitive” option that I can toggle on and off?
I created a SQL query to restore several databases from a remote location to a test environment. I would like to add a check in the script so that it will not run if connected to certain servers so production databases are not accidentally overwritten
Create a sequence called Store_seq with the following values: increment by 10, start with 500
Is there a query in SQL that could return me the name of a database, or whether it is connected to SQL Server or Oracle?
Hello, I am running on SQL server on my local PC . I am singed onto the PC using a network user. This probelm happens if the SQL server service runs as either Local system or network service. In the server management studio if I go to a query window and enter Declare @result int exec xp_fileexist...
i m a beginer in computer science.so how can i make grip on oracle sql plus is there any website or any electronic book that contains preset quries on sql which can help me in working in sql i want a guide book which has quries to start and work in sql plus and developer.
How do you use co-related queries in SQL and why would they be useful? Is there any effect on performance when executing a co-related query?
Hi, I have an SQL query that I would like to populate with veriable date information each time it runs. If I hard code the dates, I get the results I expect. However, I can not get the date parameters to work with my query. Here's the " Hard coded version (Works) SELECT...
I am trying to write a query that I can use to generate an Excel chart to show activity in our database. I have it returning rows for each minute over the previous two hours (no problem). The problem comes when I plot a line chart. If there's no activity in a given minute, there's no row...
how to find out the row_number in sql 2000 like using row_number() function in sql 2005
from this table i have to take those records that have common gridcode and then from these records i have to store the records having maximum area in another table... gridcode state area 13013 rajasthan 50000 13013 gujarat 45000 13014 rajasthan 25000 13014 gujarat ...


