Hi,
I am very new in Linq, I want to select two coloum of table. so tell me how can i write query for that .
I want to fill dropdown list .
Thanks
Manoj
SELECT id, CONCAT(lastname,', ',firstname) AS fullname, lastname, firstname
FROM " . TABLE_CONTACT . "
WHERE
CONCAT(firstname,' ', lastname) LIKE '%$goTo%' OR
CONCAT(firstname,' ', middlename,' ', lastname) LIKE '%$goTo%' OR
nickname LIKE '%$goTo%'
ORDER BY fullname";
Can anyone please tell me what is purpose of above query ? I am new to mysql so unable to understand it. Thanks
Sorry...I mean what question will be for this query?
SELECT SUM(price) FROM Room r, Hotel h
WHERE r.hotelNo = h.hotelNo and hotelName = 'Paris Hilton' and
roomNo NOT IN
(SELECT roomNo FROM Booking b, Hotel h
WHERE (dateFrom <= CURRENT_DATE AND
dateTo >= CURRENT_DATE) AND
b.hotelNo = h.hotelNo AND hotelName = 'Paris Hilton');
Does anyone have a sample of how to query for nested/inner objects in MongoDB using NORM (C#)? For example, if a typical document in a collection looks like Order/OrderItems, how can I look up a specific OrderItem by OrderItem.Quantity 10.
I have a View set to grab the latest forum posts. That's working fine, but I'd like to limit it to get the last 5 records only. I know I can display only 5 with PHP but I don't want a larger query than I need. I can't find any option for this in the View.
thanks
I'm wanting to programmatically monitor the cache size on a certain ASP.NET site. This is basically for the administration portion of a product, where we allow users to partially control whether their site uses caching or not.
Is there a way to do this. Should I be using the ManagementScope object to perform this query?
Is there a way to query a full text index to help determine additional noise words? I would like to add some custom noise words and wondered if theres a way to analyse the index to help determine suggestions.
I have a query:
The "X" tables are from one data source and the "Y" table is from another...but there is join between the data sources. I can't seem to figure out how to enter the two different connection strings for this to run.
ConnectionString="Dsn=Xdb;uid=xxx;pwd=xxxxxxx" ProviderName="System.Data.Odbc"
ConnectionString="Dsn=Ydb;uid=xxx;pwd=xxxxxxx" ProviderName="System.Data.Odbc"
Is this possible...am I just missing something?
below is how i do query cache
getHibernateTemplate().setCacheQueries(true);
List<IssSection> result = (List<IssSection>) getHibernateTemplate().findByCriteria(crit);
getHibernateTemplate().setCacheQueries(false);
may i know how to specify duration of maximum time to cache this method? let say i want to clear cache after 5 mins expirated
Hi,
Is there a way to query a JSON (String) for a specific item?
ie:
String jSon = "{\"a\":{\"b\":27472483,\"c\":\"123\"}}";
such that:
Int32 bob = (Int32)getFromJSON("a.b", jSon);
// bob == 27472483
Thank you,
-Theo
Hi all,
I'm trying to rewrite some query strings I have in my URL like this :
foo.com/index.php?page=admin&view=news&action=edit&id=3
to
foo.com/admin/news/edit/3
But can't figure it out...
it should also works if I only have the 'page' parameters for example, since I don't always have these 4 parameters (page,view,action,id) in my urls, of course.
any suggestions?
Whats wrong with my query?
ALTER TABLE test_posts ADD sticky boolean NOT NULL default = false
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=false' at line 2
Hi, let's say that I have a table called
Items (ID int, Done int, Total int)
I can do it by two queries:
int total = m.Items.Sum(p=>p.Total)
int done = m.Items.Sum(p=>p.Done)
But I'd like to do it in one query, something like this:
var x = from p in m.Items select new { Sum(p.Total), Sum(p.Done)};
Surely there is a way to call aggregate functions from LINQ syntax...?
I have identified the query constructs my users normally use. would it make sense for me to create composite indexes to support those constructs and provide FIRST_ROWS capability? If I migrate from SE to IDS, I will loose the ability to write low-level functions with c-isam calls, but gain FIRST_ROWS along with other goodies like: SET-READS for index scans (onconfig USE_[KO]BATCHEDREAD), optimizer directives, parallel queries, etc?
Hi Experts,
I have a following tables/classes structure in Linq to entities.
`
Books
{
bookId,
Title
}
Tags
{
TagId
Tag
}
BooksTags
{
BookId
TagId
}
'
Now I need to write a query which gives me result like this
Class Result
{
bookId,
Title
Tags
}
Tags should be comma separated text from the tags table by joining all three tables.
How to get it done.
Thanks
Parminder
I have two tasks and since I am new to it, I need some help/advice from the masters.
What I need to do is send the result of q select query to a csv file which can have delimeter as comma or tab and then send this file as mail to a particular receipient.
Hoping for some great advice
In essence, I have a value that I have to call a couple times in my SQL query. Thus, is it possible to reuse the same named placeholder in the statement e.g.
SELECT :Param FROM Table WHERE Column = :Param, then simply bindValue(":Param"), and have the value be there for both :Params?
Hi There,
How would I go about executing the following Hibernate query using the criteria API.
I have an object Parent with List children. I would like to search through all parents and find which parents contain a specified child.
i.e. List findParent(Child child);
Thanks.
Hi,
I need to make a Lucene exact case insensitive keyword match query.
I tried using KeywordAnalyzer but it's case sensitive ...
Sample :
Keyword : "Windows Server 2003" = Got Results
Keyword : "windows server 2003" = No results ...
Another sample (multi keywords) :
Keywords : "ASP.NET, SQL Server" = Got results
Keywords : "asp.net, sql server" = No results
I always get warning when use mysql2 do query
/usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:463: warning: :database_timezone option must be :utc or :local - defaulting to :local
I did see a option for Timezones
Mysql2 now supports two timezone options:
:database_timezone - this is the timezone Mysql2 will assume fields are already stored as, and will use this when creating the initial Time objects in ruby
:application_timezone - this is the timezone Mysql2 will convert to before finally handing back to the caller
did any one know, how to usage, and where to set this option?
Thanks.
Ok so I've got a DataTable here's the schema
DataTable dt = new DataTable();
dt.Columns.Add("word", typeof(string));
dt.Columns.Add("pronunciation", typeof(string));
The table is filled already and I'm trying to make a linq query so that i can output to the console or anywhere something like :
Pronunciation : akses9~R => (list of words)
I want to output the pronunciations the most common and all the words that use it.
executing the following query in SQL management studio provides results, whereas it does not via cfquery...
select distinct locationid, locationname, locationaliasname
from vwLocationsWithAlias
where 1 = 0
or (LocationName = N'the' or LocationAliasName = N'the')
or (LocationName = N'the republic' or LocationAliasName = N'the republic')
The results expected are returned from SQL Mgmt Studio, but nothing is returned from CFQuery. WTF!?
Please, help me. How i can translate this SQL query to LINQ request?
SELECT TOP (1) PERCENT DATEDIFF(DAY, dbo.PO.ORDER_DATE, GETDATE()) AS Age
FROM dbo.ITEMS INNER JOIN
dbo.X_PO ON dbo.ITEMS.ITEMNO = dbo.X_PO.ITEM_CODE INNER JOIN
dbo.PO ON dbo.X_PO.ORDER_NO = dbo.PO.DOC_NO AND dbo.X_PO.STATUS = dbo.PO.STATUS
WHERE (dbo.ITEMS.ITEMNO = 'MBIN001') AND (dbo.X_PO.STATUS = 3)
ORDER BY Age
Hi, let's say that I have a table called
Items (ID int, Done int, Total int)
I can do it by two queries:
int total = m.Items.Sum(p=>p.Total)
int done = m.Items.Sum(p=>p.Done)
But I'd like to do it in one query, something like this:
var x = from p in m.Items select new { Sum(p.Total), Sum(p.Done)};
Surely there is a way to call aggregate functions from LINQ syntax...?
A Project has multiple Tasks, which has multiple Assignments
Projects (1-n) - Tasks (1-n) - Assignments
A field on the Tasks table is Planned Hours.
A field on the Assignments table is Assigned Hours.
How do I get the Planned Hours and Assigned Hours for all Projects in a single query?