I have some computed columns in a table and need to know if I should set Is Persisted to true. What are the advantages? Are there any disadvantages? What does 'Is Persisted' mean?
My table has three boolean fields: f1, f2, f3. If I do
SELECT * FROM table ORDER BY f1, f2, f3
the records will be sorted by these fields in the order false, true, null. I wish to order them with null in between true and false: the correct order should be true, null, false.
I am using PostgreSQL.
I "inherited" an old Database where dates are stored as Int32 values (times too, but dates shall suffice for this example) i.e. 20090101 for Jan. 1st 2009.
I can not change the schema of this database because it is still accessed by the old programs.
However I want to write a new program using EF as the O/R-M.
Now I'd love to have DateTime-Values…
Hi All,
I am working on page(Lesson) has button called "AddToFavorite".
when i click on this button lessonID,lessonHeading is added in the Coredata.
- (NSFetchedResultsController *)fetchedResultsController {
// Set up the fetched results controller if needed.
if (fetchedResultsController != nil) {
return…
In awk, how can I do this:
Input:
1 a f 1 12 v
2 b g 2 10 w
3 c h 3 19 x
4 d i 4 15 y
5 e j 5 11 z
Desired output, by sorting numerical value at $5:
1 a f 2 10 w
2 b g 5 11 z
3 c h 1 12 v
4 d i 4 15 y
5 e j 3 19 x
Note that the sorting should…
I want to retrieve the most recently updated value in the table using an insert query.
these are the datatypes in my sql table.
int(11) // primary key auto increment, not being assigned by sqlQuery
varchar(30)
timestamp // has a default value. but i am explicit assigning it using CURRENT_TIMESTAMP
varchar(300)
…
I'm doing it this way,but get an error:
mysql> update products set products_image=(select products_image from products where products_id=2) where products_id=3;
ERROR 1093 (HY000): You can't specify target table 'products' for update in FROM clause
Hi:
I'd like to update values in one table based on corresponding values from other tables. Say you want to update prices of pieces provided by one specific manufacturer whose name is in the table Manufacturers with the Pieces table containing only the id of the manufacturer.
I've seen several solutions for MySQL…
I have seeen some examples of what I am trying to do using COALESCE and FOR XML (seems like the better solution). I just can't quite get the syntax right.
Here is what I have (I will shorten the fields to only the key ones):
Table Fields
------ -------------------------------…
Trying to solve this at this hour has gotten my mind into a tail-spin: I want to rearrange a list l into a list of n lists, where n is the number of columns.
e.g.,
l = [1,2,3,4,5,6,7,8]
n = 5
==> [[1,6][2,7][3,8][4][5]]
another example:
l = [1,2,3,4,5,6,7,8,9,10]
n = 4
==>…
Hi I'm trying to create a three fields table (date,text,real),
I can insert and update the first two fields but can't set or update the last one.
createSQL = @"CREATE TABLE IF NOT EXISTS ACTIVITIES (MYDATE DATETIME PRIMARY KEY, ACTIVITY TEXT , LENGTH REAL);";
try to insert
char…
I'm having problems with dynamic sorting using ROW Number in SQL Server. I have it working but it's throwing errors on non numeric fields. What do I need to change to get sorts with Alpha Working???
ID Description
5 Test
6 Desert
3 A evil
Ive got a Sql Prodcedure…
I am saving encrypted data to a database.
Is there a way I can create a "hashcode" or fingerprint or checksum of the plain text data, that if I sort / order by on the "hashcode" the order would be the same as if I had saved the plain text data and perform the same sort / order by…
My question is comparable to this one, but not quite the same.
I have a database with a huge amount of books, with different editions of some of the same book titles. I'm looking for an SQL statement giving me the highest edition number of each of the titles I'm selecting with a…
I am really starting to enjoy unit testing and have the following question to the gurus of unit testing.
Let's for example say I have the following class
public class FileMapper
{
public Dictionary<string, string> ReadFile(string filename, string delimeter){}
}
How…
I am trying to use Linq2Sql to return all rows that contain values from a list of strings. The linq2sql class object has a string property that contains words separated by spaces.
public class MyObject
{
public string MyProperty { get; set; }
}
Example MyProperty values…
I am using hibernate for Java, and I want to be able to select users by id or by name from the database.
Nice thing about Hibernate is that it caches the result by id, but I seem to be unable to make it cache by name.
static Session openSession = Factory.openSession();
…
I want to show the data in the tooltip when a columns has long sentences because of width constrints.
for this i am using a renderer function as follows
{
header: xppo.st('SDE_INCIDENT_DESCRIPTION1'), width: 175, sortable: true, groupable: false, dataIndex:…
Let's say:
I want to query colA, colB and colC in my table.
I want to see DISTINCT values but I don't want colA to be a criteria for distinction.
Omitting colA isn't an option.
What's the best way to structure that query?
This one seems to be a simple problem, but I can't make it work in a single
select or nested select. Retrieve the authors and (if any) advisers of a
paper (article) into one row.
I order to explain the problem, here are the two data tables (pseudo)
papers…
i have three similar files, they are all like this:
File A
ID1 Value1a
ID2 Value2a
.
.
.
IDN Value2n
and i want an output like this
Output
ID1 Value1a Value1b Value1c
ID2 Value2a Value2b Value2c
.....
IDN ValueNa ValueNb ValueNc
Looking to…