SQL Query Questions


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. Example: 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.

Answer Question   |  April 18, 2013  3:13 AM
SELECT statement, SQL, SQL Query, WHERE statement
asked by:
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 [...]

Answer Question   |  May 6, 2010  9:54 PM
Loop query in SQL, SQL, SQL Query
asked by:
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 [...]

Answer Question   |  February 6, 2009  1:22 AM
SELECT statement, SQL, SQL Query
asked by:
90 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 advance A.

Answer Question   |  January 20, 2009  11:49 PM
JOIN statement, SQL, SQL Query
asked by:
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 [...]

Answer Question   |  March 26, 2012  11:14 AM
Query, SQL, SQL queries, SQL Query, sql report, UPDATE statement
asked by:
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

Answer Question   |  January 19, 2009  4:47 PM
Access 2003, Microsoft Access, SQL, SQL Query
asked by:
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 can be connect to [...]

Answer Question   |  December 24, 2008  7:24 AM
Database configuration, Database instance, Database testing, DB2, Oracle, SQL Database, SQL Query, SQL Server
asked by:
455 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

Answer Question   |  December 15, 2008  7:43 PM
SQL Query
asked by:
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.

Answer Question   |  December 11, 2008  10:31 AM
Conditional SQL statements, SQL, SQL Query, SQL Server 2000, SQL Server 2000 Scripts, SQL Server Scripts
asked by:
25 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: [...]

Answer Question   |  December 4, 2008  4:21 PM
Parsing, SQL Query, SQL Query Parse Data
asked by:
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!!!!!

Answer Question   |  December 8, 2008  6:20 AM
JOIN statement, PL/SQL, SELECT statement, SQL, SQL Query, WHERE statement
asked by:
610 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 ’200′, ISNULL (td3.price, 0) as ’300′, ISNULL (td4.price, 0) as [...]

Answer Question   |  December 4, 2008  6:10 PM
SQL Query, SQL Server 2008, SQL stored procedures, T-SQL
asked by:
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 do? [...]

Answer Question   |  December 10, 2008  11:04 AM
Database deadlock, Database design, Database Failover, Database modeling, Database security, DB2, DBFO, Oracle, SQL Database, SQL Query, SQL Server
asked by:
455 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 2 01-12-08 2 3 01-12-08 2 2 01-12-08 3 6 05-12-08 4 10 05-12-08 [...]

Answer Question   |  December 2, 2008  4:11 PM
Oracle Database, Oracle developers, SQL Query
asked by:
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.

Answer Question   |  December 2, 2008  11:44 AM
Database deadlock, Database Failover, Database security, DB2, DBFO, Oracle, SQL Database, SQL Query, SQL Server
asked by:
455 pts.

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 projectid. like the following [...]

Answer Question   |  January 15, 2009  10:29 AM
SELECT statement, SQL, SQL Query
asked by:
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 trunc(log.resolution_date(+)) – trunc(to_date(substr(obj.last_ddl_time,1,11),’dd-mon-yy’)) >=0) OR (UPPER(log.resolution(+)) like ‘%’||obj.object_name||’%’ and log.resolution_date(+) is null) /

Answer Question   |  December 1, 2008  11:09 PM
Oracle development, Oracle SQL, SELECT statement, SQL Query, SQL statements, WHERE statement
asked by:
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 [...]

Answer Question   |  December 2, 2008  3:39 PM
SQL Database, SQL Query
asked by:
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.

Answer Question   |  December 1, 2008  4:57 AM
SQL, SQL Query
asked by:
5 pts.

How to schedule SQL query to run in Microsoft SQL Server
I have a query that I want to automatically schedule to run daily. How do I do this?

Answer Question   |  September 17, 2012  4:19 PM
Automated SQL Query, Microsoft SQL Server, Scheduled Tasks, SQL Query
asked by:
5 pts.