Hi
How Can I Import Data From a Table in Sql Server CE To Excel?
I Try This From Excel But I Can Not Find an Item for This In Excel
Please Help Me To This
So i have a SQL table setup as such
CREATE TABLE IF NOT EXISTS `points` (
`id` int(11) NOT NULL auto_increment,
`lat` float(10,6) NOT NULL,
`lng` float(10,6) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
And im inserting stuff like
INSERT INTO `points` (`lat`, `lng`) VALUES ('89.123456','-12.123456');
Gives me a row with lat and lng being 89.123459 and -12.123455
Whats up?
There's a table like this one
______________________
| id | title | order |
|----------------------|
| 1 | test1 | 1 |
|-----|--------|-------|
| 2 | test2 | 2 |
|-----|--------|-------|
| 3 | test3 | 3 |
|-----|--------|-------|
| 4 | test4 | 4 |
'----------------------'
when i introduce in my mysql shell a single update to a row
$sql UPDATE `table` SET order=1 WHERE id=3;
And then procedure or method resamples order column in the before update lower values to get its order renewed like this
______________________
| id | title | order |
|----------------------|
| 1 | test1 | 2 |
|-----|--------|-------|
| 2 | test2 | 3 |
|-----|--------|-------|
| 3 | test3 | 1 |
|-----|--------|-------|
| 4 | test4 | 4 |
'----------------------'
Any help would be appreciated, thanks!
The answer to another SO question was to use this SQL query:
SELECT o.Id, o.attrib1, o.attrib2 FROM table1 o
JOIN (
SELECT DISTINCT Id FROM table1, table2, table3 WHERE ...
) T1
ON o.id = T1.Id
Now I wonder how I can use this statement together with the keyword FOR UPDATE. If I simply append it to the query, Oracle will tell me:
ORA-02014: cannot select FOR UPDATE from view
Do I have to modify the query or is there a trick to do this with Oracle?
With MySql the statement works fine.
Does anyone know a good approach using Entity Framework for the problem described below?
I am trying for our next release to come up with a performant way to show the placed orders for the logged on customer.
Of course paging is always a good technique to use when a lot of data is available I would like to see an answer without any paging techniques.
Here's the story: a customer places an order which gets an orderstatus = PENDING. Depending on some strategy we move that order up the chain in order to get it APPROVED.
Every change of status is logged so we can see a trace for statusses and maybe even an extra line of comment per status which can provide some extra valuable information to whoever sees this order in an interface.
So an Order is linked to a Customer. One order can have multiple orderstatusses stored in OrderStatusHistory.
In my testscenario I am using a customer which has 100+ Orders each with about 5 records in the OrderStatusHistory-table.
I would for now like to see all orders in one page not using paging where for each Order I show the last relevant Status and the extra comment (if there is any for this last status; both fields coming from OrderStatusHistory; the record with the highest Id for the given OrderId).
There are multiple scenarios I have tried, but I would like to see any potential other solutions or comments on the things I have already tried.
Trying to do Include() when getting Orders but this still results in multiple queries launched on the database. Each order triggers an extra query to the database to get all orderstatusses in the history table. So all statusses are queried here instead of just returning the last relevant one, plus 100 extra queries are launched for 100 orders. You can imagine the problem when there are 100000+ orders in the database.
Having 2 computed columns on the database: LastStatus, LastStatusInformation and a regular Linq-Query which gets those columns which are available through the Entity-model.
The problem with this approach is the fact that those computed columns are determined using a scalar function which can not be changed without removing the formula from the computed column, etc...
In the end I am very familiar with SQL and Stored procedures, but since the rest of the data-layer uses Entity Framework I would like to stick to it as long as possible, even though I have my doubts about performance.
Using the SQL approach I would write something like this:
WITH cte (RN, OrderId, [Status], Information)
AS
(
SELECT ROW_NUMBER() OVER (PARTITION BY OrderId ORDER BY Id DESC), OrderId, [Status], Information
FROM OrderStatus
)
SELECT o.Id, cte.[Status], cte.Information AS StatusInformation, o.* FROM [Order] o
INNER JOIN cte ON o.Id = cte.OrderId AND cte.RN = 1
WHERE CustomerId = @CustomerId
ORDER BY 1 DESC;
which returns all orders for the customer with the statusinformation provided by the Common Table Expression.
Does anyone know a good approach using Entity Framework?
We have some JPA entity classes which are currently under development and wouldn't want them as part of the testing cycle. We tried commenting out the relevant entity classes in META-INF\persistence.xml but the hbm2ddl reverse engineering tool still seems to generate SQL for those entities. How do I tell my code to ignore these classes? Are there any annotations for these or should I have to comment out the @Entity annotation along with my changes in persistence.xml file.
Does anyone use the PL/SQL Web Toolkit at all? We use it for internal reporting where I work.
However, does anyone have any experiences of it for producing client-facing websites? General advantages/disadvantages compared to other web languages, such as JSP, PHP etc
Need to create a php file so I can send data to an sql server and get data from the server. There must also be a json support because I am doing this for an iphone app. Could you please help me and give me a source code example.
Thanks in advance.
Can't figure this one out... when I execute a select query it shows an explain plan cost of ~4500 and takes ~3 seconds to return. When I wrap that query (no changes) inside of:
select count(*) from (
/*query here*/
)
It times out. It's at 5 minutes and counting now.
I tried this in SQL Developer and Aqua Data Studio -- same results.
I have a table in the form:
test_name| test_result |
test1 | pass |
test2 | fail |
test1 | pass |
test1 | pass |
test2 | pass |
test1 | pass |
test3 | pass |
test3 | fail |
test3 | pass |
As you can see all test1's pass while test2's and test3's have both passes and fails.
Is there a SQL statement that I can use to return the distinct names of the tests that only pass? E.g. test1
Hi,
Is it possible to return a single value and an enumerable collection using LINQ to SQL?
The problem is, I'm trying to do paging across a large recordset. I only want to return 10 rows at a time so I'm using .Skip(20).Take(10) approach.
However I need to know the total number of records so I can show an appropriate page x of y.
Trying to avoid two separate queries.
Thanks
i am trying to create a statement in sql (for a table which holds stock symbols and price on specified date) with avg of 5 day price and avg of 15 days price for each symbol.
table description:
symbol
open
high
close
date
the average price is calculated from last 5 days and last 15 days. i tried this for getting 1 symbol:
SELECT avg(close),
avg(`trd_qty`)
FROM (select *
from cashmarket
WHERE symbol = \'hdil\'
order by `M_day` desc
limit 0,15 ) s
...but I couldn't get the desired the list for showing avg values for all symbols.
While there's lots to like about DataObjects.NET, I've found help resources to be a lean, and can't find a solit example of using DataObjects.NET with RDBMS generated primary keys. It would seem as though D4O won't do inserts against SQL Server unless it's in controll of the key.
Has anyone solved this in the wild?
I'm writing java application that is using both SQLite and MySQL using JDBC.
Are there any differences in SQL for those databases? Can I use same queries for both SQLite and MySQL, or is there any db specific stuff, that doesn't work on the other one?
As far I've worked only with MySQL, so I don't really know much about SQLite.
Hello.
I have a short question. Im my current project I'm using LINQ-to-SQl. That is the best way to determine if table has record with specific ID?
Thanks in advance.
hello,
i am developing wpf application..
i need your suggestions.
i have to make reports in my application...
so which one is best, by crystal report or by using sql server reporting service..
friends what you say ? give ur suggestion which one is best and why ???
I have an sql table with data like this:
| theDate (datetime) | theValue (int) |
----------------------------------------
| 2010-05-17 02:21:10 | 5 |
| 2009-03-12 04:11:35 | 23 |
| 2010-02-19 18:16:53 | 52 |
| 2008-07-07 22:54:11 | 30 |
The dates are stored in UTC format in a datetime column, how can I convert them to local time (Norway)? Remember that the UTC-offset is not the same all year because of winter/summer-time.
So this my first question here, let's look how it works.
I'm working on a project, which has to to provide a "Native XML WebService" on a SQL Server 2005. The web service and the WSDL generation works fine. But there are troubles with the authentication.
Is it possible to turn the authentication off (The tests and the documentation by Microsoft say no.)?
And if so how?
I have a sql statement I am using a simple sort such as the following
Select numbers
From theTable
Order By numbers
What I get in return is the following
1
11
12
14
2
21
22
23
3
35
37
etc...
I want it to be ordered in normal order
1
2
3
4
5
6
etc...
What is the most standard encryption technique used in sql server for asp.net c# enterprise level application? . i am talking with respect to standards like md5 or sh1 etc, hashing
I have a single MYSQL Question and need help ASAP.
Database:
Email | Name | Tag
[email protected] |Test Person | TagOne
[email protected] |Test Person | Tag Two
Need an SQL query that will return
Email | Name | Tag
[email protected] |Test Person | TagOne, Tag Two
Any help?
I am created a website using visual studio 2010. On the time of the development of website I am able to access the database.. but after publishing the site using IIS7..i was unable to access the database..the exception occured during that time was "the connection is in the closed state".in IIS7 When I changed the application pool identity to localsystem, it worked.
Data base is installed in the same machine. and server is SQL SERVER 2008 R2
I had a table (Some_Table) with two columns:
A B
-------------------
1 test
2 test
3 test1
4 test1
i would like to return DISTINCT values for column B and it's associated value in column A (first in distinct set), so something like this:
A B
-----------
1 test
3 test1
What is the sql?