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
In SQL Server, is there any way to check whether the changes in the schema will impact Stored Procedures (and/or Views)?
For example a change of the column name in one table, may break some Stored Procedures; how to check the impacted stored procs?
How to make an SQL query if there are 30 records in table and I want to pick rows from 12 to 20 where 12 and 20 are row numbers not Ids.
**Ids Code**
5 ABC
6 SDF
8 WSA
10 FSD
15 IOP
.
.
.
.
80 AWS
Is there a way to select records based using an if statement?
My table looks like this:
id | num | dis
1 | 4 | 0.5234333
2 | 4 | 8.2234
3 | 8 | 2.3325
4 | 8 | 1.4553
5 | 4 | 3.43324
And I want to select the num and dis where dis is the lowest number... So, a query that will produce the following results:
id | num | dis
1 | 4 | 0.5234333
4 | 8 | 1.4553
there!
I have this question, hope you guys can help me out.
So i have this table with two fields:
type and authorization
in type i have 2 different values: Raid and Hold
in authorization i have 2 different values: Accepted or Denied
I need to make a view that returns values like this:
TYPE:RAID ACCEPTED:5 DENIED:7
Basically i need to know how many of the values in TYPE are Raid, and then how many of
them are Accepted and Denied.
Thank you in advance!!
i have two tables with images that parts of them are transparent and i want
to ignore mouse interactions (especially clicking) on these parts and assign the
click to the image in the other table that below.
(i hope you understand because english is not my native language.)
thanks..
Hi all.
i m working sql server 2005.
My query is:
SELECT (
SELECT COUNT(1) FROM Seanslar WHERE MONTH(tarihi) = 4
GROUP BY refKlinik_id
ORDER BY refKlinik_id) as dorduncuay
And the error:
The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.
How can i use order by in a sub query?
I have one table, which has three fields and data.
Name , Top , Total
cat , 1 , 10
dog , 2 , 7
cat , 3 , 20
horse , 4 , 4
cat , 5 , 10
dog , 6 , 9
I want to select the record which has highest value of Total for each Name, so my result should be like this:
Name , Top , Total
cat , 3 , 20
horse , 4 , 4
Dog , 6 , 9
I tried group by name order by total, but it give top most record of group by result. Can anyone guide me, please?
i have one table : nobel(yr, subject, winner)
and i have this query : In which years was the Physics prize awarded but no Chemistry prize.
this is what i tried :
select distinct
yr from nobel where subject='physics' and subject!='chemistry'
but is not working where i am going wrong.
see, i am not here to make my homework from someone. i am here to learn something. so, please give me suggetion.
I want to transfer big files (1GB) over unreliable transport channels. When connection is interrupted, I don't want start file transfering from the begining. I can partially store it in a temp table and store last readed position, so when connection is reestablished I can request continue uploading of file from this position. Is there any best-practice for such kind of things. I'm currently use chunking channel.
I did following:
create or replace type my_row as object
(
lname varchar2(30),
fname varchar2(30),
MI char(1),
hohSSN char (9),
hohname VARCHAR2(63),
hohDob char(10),
dob DATE
);
create or replace type eiv.my_rec as table of eiv.my_row;
but then doing query like:
my_records my_rec
select '', '', '', '', '', '', sysdate bulk collect into my_records from dual;
gives error ORA-00947: not enough values
what can i be doing wrong here?
I've got a column in a SQL Server table that is type XML. I want to change multiple values in the XML in a stored proc. I've already found the XML.Modify(...) command and have it working for a single value. Can I change multiple values in the XML in one update command or do I need to do it as multuple update commands?
I have to retrieve an ID and last_name from my table, but my ID is not continuous and there no pattern for the gaps. How do I write a PL/SQL anonymous block for this?
I am looking for some good asp.net sample applications which use Entity Framework. I saw a couple apps for NorthWind (one was MVC based). Looking for one with is more sophisticated than the simple apps at MSDN (HRSkillsCombined, CourseManager,AdWksSalesWinDataBind, ResearchCollaborationAssistant). Possibly using Entity Inheritance, multi table change tracking.. etc.
In VS2005, I am using a DLL which accesses a SQL Server. The DLL returns a SQLException
Invalid object name 'tableXYZ'
but tableXYZ is a table in the database.
Should it be looking for dbo.tableXYZ instead? Is this a permissions issue with the login being used?
using Nhibernate;
I'm trying to insert several values a on table which has an unique index on some columns.
I'd like to know if a particular insert raises an exception for having violated the unique constraint.
So, which particular exception type should i catch? I only want to catch this particular one and let all others go up.
Thanks a lot!
Hello,
I have a table structure that looks like this:
ID String
-----------
1 A
1 Test
1 String
2 Dear
2 Person
I need the final output to look like this:
ID FullString
--------------------
1 A, Test, String
2 Dear, Person
I am really lost on how to approach this... I looked on a couple examples online but they seemed to be VERY complex... this seems like it should be a real easy problem to solve in sql.
Thank you for all assistance!
I'm trying to figure out how to add records to an existing object for each iteration of a loop. I'm having a hard time discovering the difference between an object and an array.
I have this
@events = Event.find(1)
@loops = Choices.find(:all, :limit => 5) #so loop for 5 instances of choice model
for loop in @loops
@events = Event.find(:all,:conditions => ["event.id = ?", loop.event_id ])
end
I'm trying to add a new events to the existing @events object based on the id of whatever the loop variable is. But the ( = ) operator just creates a new instance of the @events object.
I tried ( += ) and ( << ) as operators but got the error
"You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil"
I tried created an array
events = []
events << Event.find(1)
@loops = Choices.find(:all, :limit => 5) #so loop for 5 instances of choice model
for loop in @loops
events << Event.find(:all,:conditions => ["event.id = ?", loop.event_id ])
end
But I dont know how to call that arrays attributes within the view
With objects I was able do create a loop within the view and call all the attributes of that object as well...
<table>
<% for event in @events %>
<tr>
<td><%= link_to event.title, event %></td>
<td><%= event.start_date %></td>
<td><%= event.price %></td>
</tr>
<% end %>
</table>
How could i do this with an array set?
So the questions are
1) Whats the difference between arrays and objects?
2) Is there a way to add into the existing object for each iteration?
3) If I use an array, is there a way to call the attributes for each array record within the view?
I am writing an application that needs simple data found (mostly) on the periodic table of elements, such as atomic mass, atomic number, state, etc.
However, I would prefer not to manually enter this data.
I managed to find the NIST website (http://www.nist.gov/pml/data/edi.cfm) with all of the data I need, but not in a downloadable format.
Where can I find this data? Preferably, it would be in an XML/YAML/JSON/other documented format, however, any format would be helpful.
I wish to be able to change the table a class is mapped to at run time, I can’t do this if all the mappings are defined with attributes. Therefore is there a way to define the mappings at runtime in code.
(I would rather not have to maintain xml mapping files.)
Is that possible that MySQL can handle grouping of data according to age bracket?
In my users table, age value is their actual age. I want to group them according to age bracket. For example:
ages below 1 year old as age1, 1-4 yrs as age2, 5-9 yrs. old as age3 and so on.
Hello,
For the function below, I would like the link <div class="footervote"><a href="http://www...com/.../footervote.php">Vote</a></div> to only appear if the logged in user currently appears on editorlist.php. (I. e. if the loginid in the function corresponds to any of the usernames that currently appear in editorlist.php.)
Appearing on editorlist.php is something that is dynamic.
How can I do this?
Thanks in advance,
John
function show_userbox()
{
// retrieve the session information
$u = $_SESSION['username'];
$uid = $_SESSION['loginid'];
// display the user box
echo '<div id="userbox">
<div class="username">'.$u.'</div>
<div class="submit"><a href="http://www...com/.../submit.php">Submit an item.</a></div>
<div class="changepassword"><a href="http://www...com/.../changepassword.php">Change Password</a></div>
<div class="logout"><a href="http://www...com/.../logout.php">Logout</a></div>
<div class="footervote"><a href="http://www...com/.../footervote.php">Vote</a></div>
</div>';
}
On editorlist.php:
$sqlStr = "SELECT
l.loginid,
l.username,
l.created,
DATEDIFF(NOW(), l.created) AS days,
COALESCE(s.total, 0) AS countSubmissions,
COALESCE(c.total, 0) AS countComments,
COALESCE(s.total, 0) * 10 + COALESCE(c.total, 0) AS totalScore,
DATEDIFF(NOW(), l.created) + COALESCE(s.total, 0) * 10 + COALESCE(c.total, 0) AS totalScore2
FROM login l
LEFT JOIN (
SELECT loginid, COUNT(1) AS total
FROM submission
GROUP BY loginid
) s ON l.loginid = s.loginid
LEFT JOIN (
SELECT loginid, COUNT(1) AS total
FROM comment
GROUP BY loginid
) c ON l.loginid = c.loginid
GROUP BY l.loginid
ORDER BY totalScore2 DESC
LIMIT 10";
$result = mysql_query($sqlStr);
$arr = array();
echo "<table class=\"samplesrec1edit\">";
while ($row = mysql_fetch_array($result)) {
echo '<tr>';
echo '<td class="sitename1edit1"><a href="http://www...com/.../members/index.php?profile='.$row["username"].'">'.stripslashes($row["username"]).'</a></td>';
echo '<td class="sitename1edit2">'.($row["countSubmissions"]).'</td>';
echo '<td class="sitename1edit2">'.($row["countComments"]).'</td>';
echo '<td class="sitename1edit2">'.($row["days"]).'</td>';
echo '<td class="sitename1edit2">'.($row["totalScore2"]).'</td>';
echo '</tr>';
}
echo "</table>";
I am new to struts2.I am unable to populate value in side a table in my jsp page from my Action class.I have a List in my Action class.Can any body help me.
I'm building a windows mobile app. And using SqlCe.
I'm looking for a good sql query builder. So instead of writing "SELECT COLUMNS FROM TABLE WHERE etc...
Is there a good free library that can build this sort of query?