SQL Query Questions and Answers

Recent IT Questions

41 - 60 of 85

Need SQL query

I have two tables DETAIL and USER. Detail table have two columns (projectid and projectdetail). Projectid is a primary key in DETAIL table. USER table have two columns (projectid and Userid). User table is like more than one userid can be under each projectid, one user can access more than one...

View Answer   |  Nov 29 2008  10:29 AM GMT
SQL, SELECT statement, SQL Query
asked by Minuvinu

  35 pts.

SQL select

SELECT obj.object_type FROM apps.opt_log_issue log, discov.opt_changed_database_objects obj WHERE --(UPPER(log.resolution(+)) like '%'||obj.object_name||'%' -- and trunc(log.resolution_date(+)) - trunc(to_date(substr(obj.last_ddl_time,1,11),'dd-mon-yy')) <=5 -- and...

View Answer   |  Nov 28 2008  11:09 PM GMT
Oracle development, Oracle SQL, SELECT statement
asked by QAQA

  65 pts.

Finding the 3rd highest in the table using SQL.

The table name is 'Employee' with the columns Empname Sal Age A 8000 25 B 7000 24 C 6000 26 D 9000 25 what is the syntax used to find the 3rd highest. I have tried with all the syntax but no gain. I have searched in w3schools.com but was not able to find the right answer. Kindly help.... Reks

View Answer   |  Nov 27 2008  3:39 PM GMT
SQL Database, SQL Query
asked by 197579

  10 pts.

SQL Query

i want to write a SQL query to get two random question one from first set of questions and second from second set of questions.

View Answer   |  Nov 27 2008  4:57 AM GMT
SQL, SQL Query
asked by Bindi

  5 pts.

How To Schedule SQL Query To Run In Microsoft SQL Server

I have a query that I want to automate [schedule] to run daily. How do i do this?

View Answer   |  Nov 21 2008  4:19 PM GMT
SQL Query, Scheduled Tasks, Automated SQL Query
asked by House

  5 pts.

SQL to pull consecutive numbers rows

Hello, I have a table with these sample recs. ColA ColB ColC 00100 295.00 295.00 00100 295.01 295.01 00100 295.02 295.02 00100 295.03 295.03 00100 295.04 295.04 00100 295.05 295.05 00100 295.10 295.15 00100 295.98 295.98 What SQL query...

View Answer   |  Nov 19 2008  10:49 PM GMT
SQL, SQL Query
asked by WarrenDar

  5 pts.

SQL query to select highest test score

I am writing a sql to bring someone's highest test score into a table. The sql is bringing in the highest test score possible, rather than the person's test score. I assume MAX is making that happen. If I take MAX out, it returns the single row subquery returns more than one row error. What can I...

View Answer   |  Nov 18 2008  11:42 PM GMT
SQL, MAX, SQL Query
asked by Cmyers

  40 pts.

SQL query error: token DATA

I am new to Db2 on iSeries. I am running some SQL script files using JDBC to create a repository on DB2 for my project. The query is of the form: Create table tbl_name(col1 datatype(size),...... ,coln datatype(size)) DATA CAPTURE NONE; I am getting error on token DATA.. I tried to execute this...

View Answer   |  Nov 4 2008  5:54 PM GMT
AS/400, DB2, JDBC
asked by AS400 - Ask the Expert

  395 pts.

Converting a varchar to a numberic in SQL query

How can we convert a varchar field to Numberic in a SQL Query in db2 400?

View Answer   |  Nov 4 2008  5:50 PM GMT
AS/400, DB2, DB2/400
asked by AS400 - Ask the Expert

  395 pts.

Issue SQL Query with Localized String through PowerShell

Hello, I am attempting to execute a an SQL query through PowerShell against an MS Access database. My query works 99% of the time, but occasionally a localized string will cause an error beacuse it contains a single quote (') somewhere within the localized string. You can look at the following...

View Answer   |  Oct 31 2008  11:51 AM GMT
SQL, Microsoft Access, Scripting
asked by Bgsullivan

  15 pts.

SQL help

hiow to pick only alphbets in a string or a column using sql

View Answer   |  Oct 31 2008  9:43 AM GMT
SQL, Data Types, SQL Query
asked by Ecsbc

  35 pts.

Need SQL query

Hi, I have a emp table in which I have 7 columns and hiredate is one of the columns. I need to query for the hiredate which has maximum number of employees joined the company on a particular date?

View Answer   |  Oct 30 2008  8:37 AM GMT
SQL Query, SQL tables, SQL development
asked by Kirankg

  5 pts.

SQL Queries

pls any one help me I Need to disply in o/p only alphabets but not any numbers or integers for this i/p as follows i/p o/p ----- ---------- 1.2NE NE 1.1NN NN 1.3.1NE NE 1.1CE CE 1.2.2NN ...

View Answer   |  Oct 24 2008  3:42 AM GMT
SQL, Data Types, SQL Query
asked by Ecsbc

  35 pts.

I need to display only last two characters

i need to disply only last two characters in a column, the column data like this 1.3.2NE,1.2.2NN,1.10CE,1.11.1NN,10.3 for this i need output like this NE,NN,CE,NN

View Answer   |  Oct 24 2008  3:14 AM GMT
SQL, SQL Query
asked by Ecsbc

  35 pts.

Slow performance for a SQL query

I have a SQL query I am running, but it is experiencing significant slowdown. The main table - has over 1 million records and a unique key of cusID. It has a one to many relationship with the other two tables mentioned. The query code is as follows: Select customer.cusID,customer.VisitDate,...

View Answer   |  Oct 23 2008  6:22 PM GMT
SQL performance, SQL Server performance, SQL Query
asked by SQL Server Ask the Experts

  2445 pts.

Return specific level parent

Can anyone help? I have a table, with 7 records ID ParentID Level ------- ------------- --------------- 01 (empty) 1 A 01 2 BC A 3 X BC 4 B 01 2 DE B 3 Y ...

Answer Question   |  Oct 22 2008  11:04 AM GMT
SQL, Database programming, SQL Query
asked by Paulvian

  5 pts.

Extracting data from a DB2 table using IKJEFT01

I'm trying to extract data from a DB2 table via an SQL query and use IKJEFT01 to create a flat file. However, one of the non-key fields contains characters that are not nulls but non-printable. Whenever IKJEFT01 extracts these characters it changes them to nulls in the flat file. Is there an...

View Answer   |  Oct 21 2008  12:30 AM GMT
DB2, SQL Query, IKJEFT01
asked by AlanJ

  5 pts.

Get all table names by SQL

Hi, how can I get all table names of a bib by a sql-query? Thanks a lot

View Answer   |  Oct 21 2008  7:34 AM GMT
SQL, tables, SQL Query
asked by Oli001

  5 pts.

T-SQL Query- how to explode XML fragment stored as NText into table?

I'm using a commercial storefront software that offers "extension data" fields as NText to store custom data. I am storing an xml fragment that looks like this: <priceSplit xmlns="http://tempuri.org/priceSplit.xsd"> <split> <type>Credit Processing Fee</type> ...

View Answer   |  Sep 25 2008  8:03 PM GMT
T-SQL, XML, Query
asked by Lambrite

  5 pts.

Writing a query in SQL for use in SQL Server 2005

I’d like to write a query that would allow me to view items with a characteristic of my choosing and filter out the others. Is it possible to write something like this in SQL and use it in SQL Server 2005?

View Answer   |  Sep 16 2008  3:14 PM GMT
SQL, Query, SQL Server 2005
asked by SQL Server Ask the Experts

  2445 pts.

41 - 60 of 85