I am using postgres.
I want to delete Duplicate rows.
The condition is that , 1 copy from the set of duplicate rows would not be deleted.
i.e : if there are 5 duplicate records then 4 of them will be deleted.
...
I am using Querystring to pass values from one page to other. I am tring to implement encoding and decoding using the Server.UrlDecode and urlEncode.
Query string returns a null value, but I can check the values are been sent in URL.
The two pages are:
QueryString.aspx
protected void Page_Load(object sender, EventArgs e)
{
}
protec...
Hi:
My db is running on mysql v5.x. I have a table T1 with 5 columns and column C1 is the primary key. C1 is of type varchar(20). It contains about 2000 rows with values like:
fxg
axt3
tru56
and so on..
Now my application's job is to read input data and find if the input data has a starting pattern similar to that found in column C1...
Hi, I've got a trivial mysql query which isn't liked by the server really:
SELECT zone_id, SUM(inc_sec) AS voucher_used
FROM cdr_bill_2010_09
WHERE cust_id = 1234 AND voucher_id = 'XXXXXX'
GROUP BY zone_id
Now this should be really quick (and usually is) since there are indexes on both cust_id and voucher_id (voucher_id is chosen)...
Given:
You have an architecture with the layers presentation, business and data.
You are applying domain-driven design.
You are using an object-relational mapper that lets you create object-oriented queries (e.g., NHibernate which lets you create HQL queries).
Question:
Into which layer should you put the object-oriented queries?
M...
var subfacets = from l in facets.Descendants("Facet")
let FacetName = l.Attribute("Name").Value
let DisplayedFacetAttr = l.Attribute("DisplayedName")
select new
{
DisplayedFacetName = (DisplayedFacetAttr != null) ? DisplayedFac...
message table
id user_id| message
1 1 | this is my cruel message
2 1 | this is my happy message
3 2 | this is happy messgae
message_tags table
id message_id| tags
1 2 | happy
2 3 | happy
what i want to acess all the messages that have the the tag happy, how would construct...
I have a set of documents that all have a "timestamp" field which is stored as a long integer number. The field is indexed in my Lucene index as a number using NumericField with a precision step of 8: NumericField("timestamp", 8). This is done so I can do numeric range queries to retrieve all documents that fall within a specific time ...
Hello,
I want to write a stored procedure that queries XML files after I have input a certain string pattern to look for.
I'm already stuck at the input parameters, consider the following XML-document.
<root>
<container>
<element>A</element>
<option>1</option>
</container>
<container>
<element>B</element>
...
Is there a way using MySQL, to query a value containing a space, but as some sort of escape character? It's for an instant search engine I'm building (I'm trying to incorporate special search strings such as quotes to search for exact string).
cheers
...
I need this to return an exact match while still being able to use the wild card.
So when searching for 'carb' i want to return a value such as 'Racing Carb'
but i do not want to return a value such as 'Racing Carburetor'
This is what I have now...
SELECT I.SKU, I.[Description]
FROM Inventory AS I
INNER JOIN MisspelledWords AS ...
i got this pattern for searching purpose for mysql from third party javascript. im assuming its html pattern, which can be converted, anyone have any idea on this?
pattern A%5B%D9%8B-%D9%93%D9%B0%5D*L%5B%D9%8B-%D9%93%D9%B0%5D*L%5B%D9%8B-%D9%93%D9%B0%5D*
...
I am trying to get a list of product id's that do not have certain colors (database is mysql)
Here are my tables:
product
+------------+-------------+
| product_id | description |
+------------+-------------+
| 1 | Widget 1 |
| 2 | Widget 2 |
| 3 | Widget 3 |
| 4 | Widget 4 |
| 5...
We have a products table. Users can create new products as copies of existing products.
Instead of simply duplicating this data, we're thinking in order to minimize database size, we would store only the differences from the "parent" product. (were talking thousands of products)
My thinking is that, for each new "child" product, we cre...
Continuing to my subject "http://stackoverflow.com/questions/3767000/invalid-column-name-though-its-there"
I wanna write a query that selects tables that has the values of the EntityId and DataclassId columns as identical values (skipping the nulls of course)
Here is an example of my DB
Table_1
ID Sequence Type Heigh Weight ...
Actually I would like to have a query that finds all User Stories, whose all tasks and bugs are closed. The problem is that bugs are not connected directly to the user story but only to the test case, and the test case is connected to the user story. Another problem is that test cases link to user stories and are not children of them.
W...
Hi,
I have two mysql tables which both have a typeID in common. I am wanting to select everything from these two tables with the same typeID, query below:
SELECT ta.requiredTypeID, ta.typeID, ta.quantity
FROM `invtypes` as t, `typeactivitymaterials` as ta
WHERE volume > 0 AND t.typeID = ta.typeID;
This gives me the correct res...
I need to change the time part of a datetime in a database.
What I got is in the database: '2010-01-01 01:00:00'
I need to update this to '2010-01-01 03:00:00'
Only thing I have is '03:00:00'
As I'm using doctrine I could iterate through all objects but this would decrease the perfomance.
So what I tried was:
$q = Doctrine_Query::crea...
Hi,
I would like to know what are best practices for database queries. I am using C#, mysql database.
I have one application in which I had hardcoded all the database queries. Now client has modified database structure. So I have to again modify those queries and as all the queries are inside code, I need to test application, build it...
I recently migrated all my Datatables to List(Of), and bind it using .ItemSource. This works perfectly, but I run into a problem. Previously, I could filter the rows with SQL-like statements like this:
Dim dk As DataView
dk = DataGrid1.ItemsSource
dk.RowFilter = "ID > 10"
Now that I am using List(Of), i cannot use the rowfilter proper...