Hello
I have two tables in database:
CREATE TABLE items(
id SERIAL PRIMARy KEY,
... some other fields
);
This table contains come data row with unique ID.
CREATE TABLE some_choosen_data_in_order(
id SERIAL PRIMARy KEY,
id_items INTEGER[],
);
This table contains array type field. Each row contains values of IDs from table "ite...
hi!
The query is:
select employee_id
, last_name
, salary
, round((salary+(salary*0.15)), 0) as "NewSalary"
, (round((salary+(salary*0.15)), 0) - salary) as “IncreaseAmount”
from employees;
Can I optimize this round((salary+(salary*0.15)), 0) part in anyway, so that it doesn't appear twice? I tried givi...
We have a view that, without constraints, will return 90 million rows and a reporting application that needs to display paged datasets of that view.
We're using nhibernate and recently noticed that its paging mechanism looks like this:
select * from (select rownumber() over() as rownum,
this_.COL1 as COL1_20_0_,
this_.COL2 as...
I have 5 Tables in MS Access as
Logs [Title, ID, Date, Author]
Tape [Title, ID, Date, Author]
Maps [Title, ID, Date, Author]
VCDs [Title, ID, Date, Author]
Book [Title, ID, Date, Author]
I tried my level best through this code
SELECT Logs.[Author], Tape.[Author], Maps.[Author], VCDs.[Author], Book.[Author]
FROM Logs
, Tape
, Ma...
SELECT MAX(verification_id)
FROM VERIFICATION_TABLE
WHERE head = 687422
AND mbr = 23102
AND RTRIM(LTRIM(lname)) = '.iq bzw'
AND TO_CHAR(dob,'MM/DD/YYYY')= '08/10/2004'
AND system_code = 'M';
This query is taking 153 seconds to run. there are millions of rows in VERIFICATION_TABLE.
I think query is taking long because ...
When in 'SQL Server Configuration Manager' I see, under 'SQL Server Services', 2 items that look like SQL Server's:
SQL Server (sqlexpress)
SQL Server (mssqlserver)
Does that mean I have 2 versions installed at the same time? The 'SQL Server (mssqlserver) is currently stopped).
...
I have a question regarding the SQL joins -
Whenever we join two different tables on some fields, what will happen exactly inside oracle which will result in the query output?
Does Oracle create/use a temporary table just for presenting the query output?
...
I am developing a student registration form in asp.net. there are two tables viz std_registration and gallery(having pic_id and pic_url). During registration, before the click of submit button i want to retrieve pic_id from gallery table and then pass it to the insert query of registration table.
image upload is an optional part. if no ...
I am working on a script, that needs to be run in many different SQL servers. Some of them, shared the same structure, in other words, they are identical, but the filegroups and the DB names are different. This is because is one per client.
Anyway, I would like when running a script, If I chose the wrong DB, it should not be executed. I...
I want to make this kind of query:
create procedure something
@name varchar(13)
as
begin
select *
from WORKER
where NAME LIKE "%@name%"
end
For input @name=ho, I want output every row that contains NAME wich sounds "ho",
for example HOuse, soHO, broHOw...
...
How to create reasonable expression to store password in database using Doctrine and Zend_Auth::setCredentialTreatment()?
I don't want to use md5() and the code must be portable, and with salt.
I would call this not easy one to guess:
setCredentialTreatment("SHA1(CONCAT(username, SHA1(CONCAT(username, ?)))");
but it is not portable t...
Anyone know of a Ruby SQL parser?
...
I'm trying to implement this style of paging:
http://www.4guysfromrolla.com/webtech/042606-1.shtml
CREATE PROCEDURE [dbo].[usp_PageResults_NAI]
(
@startRowIndex int,
@maximumRows int
)
AS
DECLARE @first_id int, @startRow int
-- A check can be added to make sure @startRowIndex isn't > count(1)
-- from employees before doing any actu...
In a SELECT statement I want to convert values to strings ie. SELECT TO_STRING(value).
How can I do this in Oracle SQL?
...
I have a table in SQL Server 2005.
I want to show all domain name in a dropdownlist maintaing the same hierarchy. i.e
Law
Engineering
--civil
--Mechanical
Medical
--Dental
----Cavity
--MBBS
I need to append '--' according to the domain level. Is it possible using a sql query.
or alternatively can I have any other ...
I recall reading about XML support from MySql. Does anyone know how to get XML without writing code? My client-protocol expects XML and I have a data source that I can access from a web app (JSP using JDBC).
...
I'm trying to build a multi-level "game". A randomly generated option (Option1) will trigger other options in a drop down (Option2)...the options in the new drop down will be directly related the to Option1. Option2 will then trigger another drop down with info directly related to Option2 and so forth until reaching OptionEnd...any sug...
I need to use InnoDB storage engine on a table with about 1mil or so records in it at any given time. It has records being inserted to it at a very fast rate, which are then dropped within a few days, maybe a week. The ping table has about a million rows, whereas the website table only about 10,000.
My statement is this:
select url
fro...
hi,
i have to get the last day of the current month. how can i get
...
I have a view (actually, it's a table valued function, but the observed behavior is the same in both) that inner joins and left outer joins several other tables. When I query this view with a where clause similar to
SELECT *
FROM [v_MyView]
WHERE [Name] like '%Doe, John%'
... the query is very slow, but if I do the following...
SELE...