Let say I have a simple Stored Procedure:
ALTER PROCEDURE [dbo].[myProc]
AS
BEGIN
SELECT * FROM myTable
END
How can I do a WHERE statement in Microsoft SQL Server Management Studio to the stored procedure? Something like that:
SELECT * FROM myProc WHERE x = 'a'; -- But that doesn't work...
...
I have a situation where a certain linq query that runs against a multi-million row table is taking far to long to run. I dissected the linq query output and found that it was creating the parameters for the where clause using the wrong data type. For instance, one field was defined as a Char(12) in the database, but the parameter it was...
I'm starting to get a much better grasp on PostgreSQL indexing, but I've run into an issue with the OR conditional, where I don't know how to go about optimizing my indexes for a faster query.
I have 6 conditionals that, when run individually, appear to have a small cost. Here's an example of the trimmed queries, including query plan c...
Hi,
CakePHP is driving me nuts!
Here is my code:
if($this->Page->save($datavalue))
{
$this->Session->setFlash('Page content updated successfully.');
}
else
{
$this->Session->setFlash('Page content was not updated.');
}
it always says updated successfully, but nothing is updated in the database.
Here is the content of $datavalue:
Ar...
Hi all,
I want to add a left join on TASK table when the following condition occurs:
LEFT JOIN FETCH
PROMPT p on (t.id = p.task.id and p.applicationName in ('XXX'))
Here is my hql query:
select
distinct t
from
TASK t
LEFT JOIN FETCH
SERVER ser
...
I am trying to use Keyword Query object in asp.net application.
I wrote this code :
Namespace : using System.Data.SqlClient;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Search;
using Microsoft.SharePoint.Search.Query;
Page load event:
GridView grd = new GridView();
...
In an SQL table I keep bookings for various resouces, with a StartDate/EndDate column:
ResourceID, StartDate, EndDate
-----------------------------------
1 2009-01-01 2009-01-05
1 2009-01-07 2009-01-10
2 2009-01-03 2009-01-18
I need to produce a list of all resources that are available for at lea...
hi
1) The following query obtains from each film category the cheapest
possible DVD with the highest rating:
SELECT FilmName, Rating, DVDPrice, Category
FROM Films AS FM1 INNER JOIN Category AS C1 ON C1.CategoryId = FM1.CategoryId
WHERE FM1.DVDPrice =
(SELECT MIN(DVDPrice)
FROM Films AS FM2
WHERE FM2.DVDPrice IS NOT...
I'm a beginner and trying to generate as much of my own code as possible without just constantly asking others to write it for me, so with regard to this question I'm looking for hints in the right direction, rather than outright working examples. You people are all very talented, but I learn best if I reason it out myself. Should I hit ...
I'm very interesting in inexpensive (better free) SQL query tool for working with multiple databases.
Generally speaking it should works with all databases which Hibernate supports, but it must work with Microsoft SQL Server (2000/2005/2008), Oracle (9i/10g/11g), Postgres 8.x, Sybase, Firebird, MySQL and HSQLDB.
Must have features:
...
I'm writing a query to get ALL of the products in the products table, and the sale price for each product IF a record exists for that item in the specials table.
What I'm looking for is something like:
SELECT * FROM products P
IF (S.specials_date_available <= NOW() AND S.expires_date > NOW())
{ // The sale has started, but has not yet ...
Hi all,
I'm currently exploring HDF5. I've read the interesting comments from the thread "Evaluating HDF5" and I understand that HDF5 is a solution of choice for storing the data, but how do you query it ? For example, say I've a big file containing some identifiers : Is there a way to quickly know if a given identifier is present in the...
Hello guys...
I have a Client class like that:
public class Client
{
public Person Pers { get; set; }
}
And I have 2 Person´s child class :
public class PersonType1 : Person
{
protected string att1;
protected string att2;
}
public class PersonType2 : Person
{
protected string att3;
protected string att4;
}
pu...
I am new to PHP and working on my own CMS for a project. Mostly to just give myself a project to learn the language. The CMS is working but I am just tracking down some bugs in it. So here it goes...
I am trying to list all of my published articles for each section.
It does this correctly but I am having an issue in the code statemen...
I would like to query the AOT to see if a table name exists using X++. Can anyone point me in the right direction or provide some sample code for doing that?
If table exists with the name (str tableName) provided, return true; else, return false.
Thanks
...
I'm not sure how to ask this question, so I'll start with an example of what I'm doing.
Here is my table structure...
Documents (Primary key = ID)
ID, Title, LatestApprovedRevID
Revisions (Primary key = ID)
ID, DocumentID, RevisionNum, Body
Document_Reads (Primary key = DocumentID, UserName)
DocumentID, UserName, RevisionID
When a u...
I'm trying to write an SQL query that would search within a CSV (or similar) array in a column. Here's an example:
insert into properties set
bedrooms = 1,2,3 (or 1-3)
title = nice property
price = 500
I'd like to then search where bedrooms = 2+. Is this even possible?
...
I have a MySQL database where users can list books they've read, want to read etc. I'm trying to write a query to find the most common book that users have listed.
My current query is:
$result = mysql_query("SELECT title, COUNT(title) AS counttitle FROM books GROUP BY title ORDER BY counttitle DESC LIMIT 1");
echo "<p>The ...
I just ran into a SQL query with about 5 different columns in the ORDER statement, is it a good practice and how does it play with performance?
...
hello, i am looking for an SQL query, that selects exactly rows ordered by date from a table. for this there is a column that contains a timestamp.
and here comes the tricky part:
it should not select rows that are older than a certain time, but it should still select at least X rows.
so if in the given time there are not more than X ...