SQL Query Questions and Answers

Recent IT Questions

21 - 40 of 85

two dimentional output

I have a table. The structure looks like this: id(pk) year col1 col2 date 1 2008 50 60 feb09 2 2008 40 70 feb10 3 2009 60 80 feb23 4 2009 50 70 feb24 5 2008 40 80 feb26 I have no idea how to write a sql query to output a table which...

View Answer   |  Feb 17 2009  5:53 PM GMT
SQL tables, SQL Query, Two-dimensional Output
asked by Zhao

  5 pts.

Sql Query

hi all ..please help me ....what's wrong in this query ..i'm using it in java :String sql="insert into Etudiant(Nbetudiant, Pass, Nom , Prenom , Adress , Tel , Email , Sexe , Fax , Diplome , Date) values('"+ Nbetudiant + "','"+ pass +"','"+ Prenom +"','"+ Adress +"','"+ Telephone...

View Answer   |  Feb 6 2009  6:47 PM GMT
SQL Query, Java
asked by UL

  15 pts.

How to find a string in all columns of a table

I want to search for a string for example "POLARIS" in all the columns of a table ? How to find the string using sql query ?

View Answer   |  Feb 6 2009  7:18 AM GMT
Search string, SQL Query, SQL
asked by Dhumane

  5 pts.

SQL Server Query Help Needed

I have a table with Inventory transacation records. The table contains both Shipment (outgoing) and Receiving (incoming) transactions. I'm trying to write a report that lists both Sales Orders that result in Shipment records and Purchase Orders that result in Receiving records. If I link the...

View Answer   |  Feb 5 2009  10:39 PM GMT
SQL Server Query, SQL queries, SQL Query
asked by Arlin

  70 pts.

Help on SQL Query

Hi, I have a table which has customer order and date in the below format. customer order Date 1 1a 02/10/2008 19:48 1 1b 02/10/2008 18:48 1 1c 02/10/2008 17:48 1 1d 03/10/2008 19:48 2 2a 01/11/2008 01:30 2 ...

View Answer   |  Feb 5 2009  6:35 PM GMT
SQL, SQL Query
asked by GIG

  240 pts.

How to find a specific word in a SQL table

How do you write a SQL query to find a specific word in a sql column. ex I want to show all records that have the word bob in it but do not want to include records that are bobby or bobble etc only the exact word bob. Hope that makes sense

View Answer   |  Jan 29 2009  3:13 AM GMT
SQL Query, SELECT statement, WHERE statement
asked by Boomer1

  5 pts.

How to create a loop query in SQL.

Hello Friends, I am trying to write a SQL code to pull all the parts in a chain. For eg., Part A is replaced by Part B and Part B is replaced by Part C and C to D and so on. Is there anyway that I can pull all the parts in that loop at once. A,B,C,D,....., All these relationships are stored in...

View Answer   |  Jan 28 2009  9:54 PM GMT
Loop query in SQL, SQL, SQL Query
asked by Coolams

  5 pts.

Pulling multiple values in the same line in SQL

Sorry if the title is a bit vague but its almost what am I trying to solve. The best way to explain my issue is this. If I have a table which takes the format.. user_id, error_code. (and other values also). The problem is that the same user_id is listed multiple times for each error_code the...

View Answer   |  Jan 27 2009  1:22 AM GMT
SQL, SELECT statement, SQL Query
asked by Boardpig

  65 pts.

can you help on this query?

I am new to sql and cannot work out the query for this: >>>List the films in which 'Harrison Ford' has appeared <<< movie(id, title, yr, score, votes, director) actor(id, name) casting(movieid, actorid, ord) The whole exercises can be found on http://sqlzoo.net/3.htm thanks in...

View Answer   |  Jan 19 2009  11:49 PM GMT
SQL, SQL Query, JOIN statement
asked by Cateye

  5 pts.

MS SQL query to update a table with the last entry in another table.

Hi, Could anyone please assist. I'm trying to update a Reporting Table with the last entry in another table. I've tried to arrange the table according to the ID row. This works great. Then the query to get the last entry woks as well, but to get the two to work together and update the table is...

View Answer   |  Jan 19 2009  11:14 AM GMT
SQL, Query, SQL Query
asked by GPNel2006

  75 pts.

MS Access 2003 write in SQL query to convert string to numeric

How do I write in SQL code in MS Access 2003 to create a query that converts a string into a numeric? Thanks

View Answer   |  Jan 5 2009  4:47 PM GMT
SQL, Microsoft Access, Access 2003
asked by SacramentoSil

  25 pts.

How to configure the database instance to respond slowly for any request?

With default configuration settings at DB instance, the db server is responding quick. For my tests, i want the db server response to be slow. What configuration changes or anything else can be done so that the db instance will respond slowly (atleast take 1 minute time to execute). The request...

View Answer   |  Dec 16 2008  7:24 AM GMT
Oracle, DB2, SQL Server
asked by Saimadhu

  370 pts.

show zero sum in sql query

i want to display for all regions sum value. The region 4 is 0 but it is not displaying 0

View Answer   |  Dec 10 2008  7:43 PM GMT
SQL Query
asked by Rola777

  20 pts.

SQL Server 2000 script

Hi , How can we use SQL 2000 script to call 2nd maximum date? case : Item A has few price with different effective_date, Ihow can i call an item's price with second max(effective_date). Thanks in advance.

View Answer   |  Dec 9 2008  10:31 AM GMT
SQL, SQL Server 2000, SQL Query
asked by Beginer2008

  15 pts.

I want to parse data from one field into two based upon criteria.

I have lots of data with disparate information in one field and I need to take all information to the right of any * that might appear into a separate field? There will be an * about 10% of the time. Examples of the field in question. Example 1: CKD Stage I ****250.40/585.1 Example 2:...

View Answer   |  Dec 4 2008  4:21 PM GMT
Parsing, SQL Query, SQL Query Parse Data
asked by JohnSouthFlorida

  5 pts.

How can I join 3 tables using JOIN keyword

Hi Experts, Pls hlp me with my query How can i join 3 tables using JOIN Keyword inside PL/SQL block in SELECT ... WHERE clause Query 3 Tables namely Reg,ROOTS,ME and the select statement takes both parameter variable and local variable Thanks!!!!!

View Answer   |  Dec 4 2008  6:20 AM GMT
SQL, PL/SQL, SELECT statement
asked by Inprise

  525 pts.

how can make this SQL Server query faster

All, how can I make this query faster? Here is my code of stored procedure: ALTER procedure [dbo].[GetLMPReport] ( @typeId tinyint, @dataType varchar(2), @date date ) AS begin select distinct p.name, ISNULL (td24.price, 0) as '00', ISNULL (td1.price, 0) as '100', ISNULL (td2.price, 0) as...

View Answer   |  Dec 3 2008  6:10 PM GMT
T-SQL, SQL Server 2008, SQL Query
asked by Singhal1

  20 pts.

How to test whether the Database tables designed to avoid deadlock occurence?

I heard from our dev team that our db tables are designed such that there is no chance of deadlock. How to test whether the Database tables design avoids deadlock? By reviewing the db scripts (table creation) can we find whether the db table design is deadlock proof or not? What else can we...

View Answer   |  Dec 3 2008  11:04 AM GMT
Oracle, DB2, SQL Server
asked by Saimadhu

  370 pts.

SQL Query

Hello everyone, I have the following table: CREATE TABLE MKW ( ID NUMBER, UREN NUMBER, DATUM DATE ); It has the following records: SQL> select * from mkw order by datum,id; ID UREN DATUM ---------- ---------- -------- 1 3 01-12-08 1 ...

Answer Question   |  Dec 2 2008  4:11 PM GMT
Oracle developers, SQL Query, Oracle Database
asked by Mariane

  10 pts.

How to push the Database into deadlock state?

Hi, We are doing Database FailOver testing (DBFO). As part of this, we want to check if primary db is in deadlock state then what happens? whether the transactions will go to back up db or not? How to get the primary db into deadlock state? Appreciate your help.

View Answer   |  Dec 1 2008  11:44 AM GMT
Oracle, DB2, SQL Server
asked by Saimadhu

  370 pts.

21 - 40 of 85