Hi. I am a newbie programmer. I have a page looks like below. I have a car database and i have to make a search from database with this page. There are many criterias that Users can enter and select values. But User doesn't have to fill or select all criterias. For example User can search a car that only depends on "Mark" or can search t...
I have a query which I use to grab specific dates and a price for the date, but now I'd like to use something similar to grab the avg prices for particular days of the week.
Here's my current query which works for specific dates to pull from a table called availables:
SELECT rooms.name, rooms.roomtype, rooms.id, max(availables.updated_...
I wonder if anyone can help me.
I need a tsql function to split a given value such as:
1) 00 Not specified
3) 01-05 Global WM&BB | Operations
2) 02-05-01 Global WM&BB | Operations | Operations n/a
I need to get a result like this:
cat1 cat1descr cat2 cat2descr cat3 cat3descr
---------------------------------...
Hello, I'm creating 'generic' wrapper above SQL procedures, and I can resolve all required parameters' names and sqltypes, but is there any way how to get it's 'underlying' .NET type?
My goal is to do something like:
SqlParameter param;
object value;
object correctParam = param.GetNETType().GetMethod("Parse",
new Type[] { typeof(...
what is the SQL to display a number (200909) as Sep 2009 in Teradata 12
...
I am trying to understand the tempDB and following are the doubts popping in my mind.
What is the lifetime of data in tempDB? Say a query is doing some Order By and uses tempDB for performing that. After this query finishes, someone else also executes a query which utilizes the tempDB. Will the second query find records written by firs...
I have confusion on how to prevent duplicate InvoiceNo against CompanyId. I just have prepare an Invoice project that has field like CompanyId and InvNo. Both do not have Unique Keys because Company ID and InvoiceNo both have to repeated. as per below
CompanyID InvNo
1 1
2 1
1 2
3 1
4 ...
Is there an SQL command on the AS400/iSeries/System-i/whatever to add a column to a table in a specific ordinal position, or moving an existing column to a different position?
...
I have a generalized search where I'm looking up average prices for the various days of the week. The problem is I'm not sure how to ask for an odd range. 1-7 works fine, (monday-sunday), but if the user passes a sunday to a tuesday... ie 7-2 it doesn't work.
1-7 (1,2,3,4,5,6,7)
7-2 (7,1,2)
etc.
How else can I pass a range that is m...
In PostgreSQL:
I have a Table that has 3 columns:
CustomerNum, OrderNum, OrderDate.
There may(or may not) be many orders for each customer per date range. What I am needing is the last OrderNum for each Customer that lies in the date range that is supplied.
What I have been doing is getting a ResultSet of the customers and querying ...
I have a SQL that can be simplified to:
SELECT *
FROM table
WHERE LOCATE( column, :keyword ) > 0
ORDER BY LOCATE( column, :keyword )
You can see there is a duplicate of "LOCATE( column, :keyword )". Is there a way to calculate it only once ?
...
Hi guys... I've a MySQL question
I've two tables (posts and authors) in a one to many relationship (since each post is written by an author and an author can write multiple posts).
So here are the tables:
Authors:
id:BIGINT, name:VARCHAR(255)
Posts:
id:BIGINT, author_id:BIGINT, body:TEXT
I've got 700,000 posts and 60,000 au...
Hey all,
I have a requirement where I need to generate a report about current software projects. Two of the columns are the date of the latest milestone and the date of the milestone previous to that. Obviously, milestones are stored in a transaction table so we can have many milestone per project.
I've gotten to here so far, but now...
I need to do something like this to fill a parts table:
SELECT (CASE t1.part IS NULL THEN t2.part ELSE t1.part END) AS partno,
t3.desc
FROM t1
LEFT JOIN join t2 ON [certain condition]
LEFT JOIN t3 ON t1.part = t3.part
OR t2.part = t3.part
...so this will select the value for partno from t2 in case that part i...
If I use OnError event handler in my SSIS package, there are variables System::ErrorCode and System::ErrorDescription from which I can get the error information if any things fails while execution.
But I cant the find the same for OnTaskFailed event handler, i.e. How to get the ErrorCode and ErrorDescription from the OnTaskFailed event ...
I'm having trouble creating this stored procedure on IBM Informix Dynamic Server Version 10.00.FC9 (see Jonathan Leffler's answer to this post here) using the 'isql' command from Informix SQL.
I get an error on the ( char for each of his two examples near RETURNING CHAR(8)
ex. 1:
CREATE PROCEDURE ampm_time(tm SMALLINT) RETURNING CHAR(...
I have a report which on execution connects to the database with my_report_user username. There can be many end-users of the report. And in each execution a new connection to the database will be made with my_report_user (there is no connection pooling)
I have a result set which I think can just be created once (may be on the first run ...
I have to perform many selects from an Oracle external table.
I have 10 cursors that look a lot like this (ext_temp is the external table)
CURSOR F_CURSOR (day IN varchar,code Number,orig Number)
IS
select NVL(sum(table_4.f),0)
from ext_temp table_4
where
--couple of conditions here, irrelevant for the question ...
Working on parsing a bunch of databases put together in an older, more freewheeling time into a new schema. Basically it's one database per year, with database names like foo98, foo99, foo2000, etc.
So for the most recent foo data, I can do something like
SELECT foo_person.mdname AS middle_name,
...
FROM foo_person, foo_place, foo_thin...
I have 4 tables: tempTBL, linksTBL and categoryTBL, extra
on my tempTBL I have: ID, name, url, cat, isinserted columns
on my linksTBL I have: ID, name, alias columns
on my categoryTBL I have: cl_id, link_id,cat_id
on my extraTBL I have: id, link_id, value
How do I do a single query to select from tempTBL all items where isinsrted = 0 ...