I'm using NHibernate and I have a query which I want to run, which involves returning the whole table plus a count and group by. From what I've read online you can't do this with NHibernate Criteria.
To get round this, I'm using a named query:
SELECT id, COUNT(id) AS myCount
FROM foo INNER JOIN bah
ON foo.id = bah.fooId...
I have 2 tables, say table A and table B and I want to perform a join, but the matching condition has to be where a column from A 'is like' a column from B meaning that anything can come before or after the column in B:
for example: if the column in A is 'foo'. Then the join would match if column in B is either: 'fooblah', 'somethingfo...
Maybe I am day-dreaming but I am about to merge the contents of two large tables which represent two companies versions of the same data. I'd like to avoid duplicates (entries with the "title" field from DB 1 being almost the same as the "title" from DB 2. Are there any methods in php or mysql do do close string matches and return a rele...
Hi everyone
I need to filter out junk data in SQL (SQL Server 2008) table. I need to identify these records, and pull them out.
Char[0] = A..Z, a..z
Char[1] = 0..9
Char[2] = 0..9
Char[3] = 0..9
Char[4] = 0..9
{No blanks allowed}
Basically, a clean record will look like this:
T1234, U2468, K123, P50054 (4 record examples)
Junk d...
I have an HTML table structure that looks something along the lines of:
PRICE QUANTITY TOTAL
[5____] [2____] 10 (TOTAL1=PRICE1*QUANTITY1)
The values in the price and quantity column are editable. These are HTML form fields.
The values in the total column are not editable. Instead they are direct functions of the colu...
When doing a SQL Query and I want to pull up entries from a table that have AND in the name, but I do not want names that just have and in them.....
Confusing, but I'll show an example
2 Entries in the table : Pandomniam, and Frank and Beans.
When I do the query I just want Frank and Beans to come up, not Pandomniam. I am doing som...
I need an extra set of eyes on this one. Any help will be greatly appreciated. This is a very simple search query, but for whatever reason I cannot find the bug. Well, I know where the bug is. I just can't get past it. Anyway.....
I am taking a search value from a POST variable, setting that variable and then setting a column variable a...
I have two tables with columns:
Genres: ID, genre
Adjectives: ID, adjective_title
I need to do a select that returns the matching values from both tables columns with the 'like' syntax.
For example if "ep" was the value entered using 'like' the results would look like:
result_column:
epiphonic (from genres table)
epic (from adjecti...
I have been seeing quite a large variation in response times regarding LIKE queries to a particular table in my database. Sometimes I will get results within 200-400 ms (very acceptable) but other times it might take as much as 30 seconds to return results. I understand that LIKE queries are very resource intensive but I just don't und...
I have a table with 117000 or so records. I need to perform a search that checks 3 separate fields for a given string pattern.
My where clause is as follows:
field1 LIKE '%' + @DESC + '%'
OR field2 LIKE '%' + @DESC + '%'
OR field3 LIKE '%' + @DESC + '%'
This seems to take about 24 seconds regardless of input...
Is there a better way ...
Hi,
I have found this answer useful:
Accent and case insensitive COLLATE equivalent in Oracle, but my question is regarding LIKE searching with a version 9 Oracle db.
I have tried a query like this:
SELECT column_name FROM table_name WHERE NLSSORT(column_name, 'NLS_SORT = Latin_AI') LIKE NLSSORT('%somethingInDB%', 'NLS_SORT = Latin_AI...
I am wondering what the performance of a query would be like using the LIKE keyword and the wildcard as the value compared to having no where clause at all.
Consider a where clause such as "WHERE a LIKE '%'". This will match all possible values of the column 'a'. How does this compare to not having the where clause at all.
The reason I...
I have the following code within a stored procedure.
WHERE
WPP.ACCEPTED = 1 AND
WPI.EMAIL LIKE '%@MATH.UCLA.EDU%' AND
(WPP.SPEAKER = 0 OR
WPP.SPEAKER IS NULL) AND
WPP.COMMENT NOT LIKE '%CORE%' AND
WPP.PROGRAMCODE = 'cmaws3'
The NOT LIKE statement is not working, and yes before anyone says anything there are items with the COMMEN...
Allo,
EDIT:
1- OPEN FIREBUG, on the console tab
2- OPEN YOUR GMAIL ACCOUNT,
3- when gmail is loaded, click on one of your label (at the left under the draft box)
4- WITH FIREBUG YOU SEE THAT THE PAGE DOES NOT COMLETLY RELAOD SINCE ALL PREVIOUS ACTION STILL THERE FOR THE CURRENT DOCUMENT, BUT THE BROWSER COMPLETLY ACT LIKE THE PAGE...
How to write a dynamic linq method for Like clause.
For.: the reference for Dynamic linq orderby is http://stackoverflow.com/questions/41244/dynamic-linq-orderby.
I am looking for a similar one for dynamic Like clause.
I have the following extension methods for like:
public static IQueryable<T> Like<T>(this IQueryable<T> source, str...
Hi guys, bear with me, this may be a long one.
Thanks in advance for the help.
I have a function in SQL server 2008 that takes a string: 'A,B,C,D' and splits it and creates a table of the values.
Values
------
A
B
C
D
I now want to search a table (Users) Where a column value is LIKE one of the rows (surname) in the above table.
Thi...
As I see LIKE operator can optimize query if I switch PRAGMA case_sensitive_like=ON. I measured, it really worked, queries "LIKE someth%" becomes ten times faster on a compartively large binary indexed tables.
But the problem is that my library implemented as an add-on to my application, it maintains its own tables with any db it is conn...
Assume I have a large dataset and I want to run a "like" function in the dataset eg column - Name
Is there any way to run a like statement in a dataset.
Is it possible with ASP.NET?
I dont want to run a query to the database.
Thanks
...
I implemented MySQL fulltext search and worked perfect.
Now the client wants that partial matches be found by the search, for example the term 'base' should match 'database'.
I know the whole idea of fulltext search is based on word delimiters, and searching for full words.
I know I most likely will have to use an undesirable LIKE '%$ter...
Is it possible to combine LIKE and IN in a SQL Server-Query?
So, that this query
SELECT * FROM table WHERE column LIKE IN ('Text%', 'Link%', 'Hello%', '%World%')
Finds any of these possible matches:
Text, Textasd, Text hello, Link2, Linkomg, HelloWorld, ThatWorldBusiness
etc...
...