Need help with some kind of join here. Cant figure it out.
I want to loop out the forum boards, but I also want to get last_post and last_posterid from posts, and based on last_posterid get username from users.
This is how far I've come yet (:P):
SELECT name, desc, position FROM boards b
INNER JOIN posts p ON ???
INNER JOIN users u ON...
Hi All,
I wrote a trigger for a table for insert ,update. For every insert and
update, in the trigger I am comparing rows from 'Inserted' table and rows
from 'Deleted' table.
I need to get the affected column. How to do this?
A B C D
1 2 3 5.
I am updating B's value with 3. Then the trigger will fire. In that trigger,
from deleted t...
I know there is already a question like this, but I have found this page on the Android Developemt site: http://developer.android.com/reference/java/sql/package-summary.html
which seems to suggest that it is possible to interface to a SQL database.
If this is possible then could someone please show me how it can be done.
...
Hello,
I have had my experience with MSSQL Server somewhat 6 years ago, so I have only basic knowledge of its workings now.
The problem I'm posed with is that of syncing the databases between two live CRMs (NopCommerce and Rainbow Portal-based one if anyone's curious) running on the same DB server. The data I'm interested in is spread ...
Let's consider this basic insert
insert into TableName (Col1,Col2,Col3) values (Val1,Val2,Val3)
i want this insert to be done only if Val1 !=null and Val3!=null
How to accomplish this?
...
I have to update a column in a very, very large table. So performance is a big issue.
The question is the similar to this one, but only for Sybase Adaptive Server Enterprise (ASE 12.5.4) plus I need to do an update on the retrieved rows. Is there a way to do it without a self join like in the top voted answer for Oracle?
This was the f...
I have this stored procedure, that reads data from xml and make some inserts
ALTER procedure [dbo].[SP_InsertIOs]
@iosxml xml AS
DECLARE @currRecord int
-- parse the records from the XML
EXECUTE sp_xml_preparedocument @currRecord OUTPUT, @iosxml
BEGIN TRY
INSERT INTO SN_IO ( [C1] ,[C2] ,[C3] )
SELECT [C...
ResultSet rs=st.executeQuery(
"select j.vc_jo_no,
j.dt_jo_date,
p.vc_product_name
from mst_jobcard j,
mst_prod p
where j.vc_product_code=p.vc_product_code
and j.dt_jo_date=to_char("+tdate+","+"'"+dd-mm-yy+"'"+")
");
In my specified query it should display the records based o...
i need to insert 4 column in sql table
fist 2 column i have type remain 2 column i have to get it from another table ..how combine and insert this in single query
...
I am trying to access an SQL database remotely.
Can someone give me a hint or idea about how to do this in the iPhone?
...
I see a LOT of resources about producing feeds from T-SQL2005, about parsing XML into a database schema, processing, bulk operations, etc. What I don't see is how to have, for example, a statement/s in a stored proc or function which can simply access a URL for an XML feed, load the XML into a table field or sproc variable and close the...
like i declared a table...
declare @tempTable TABLE
(Id bigint identity(1,1),
bKey int,
DateT DateTime,
Addres nvarchar(max),
unit bigint)
and i want to drop it...but im stucked coz drop table n truncate are not working.
ani ideaaa...???
...
I'm writing a stored procedure that should sync a table from our production environment to our test environment (once a day).
I have 2 tables. To make it easy lets call them Meters and Measurements.
Meters = [Meter_id, Location]
Measurements = [Meter_id, Value, MeasurementTime]
I want to keep Measurements in sync and lets assume that...
I am BI Manager on top of a SAP installation. I have a SAP DB which the SAP application writes data to. In order to get an environment to query without loading on the sap, I have mirrored the SAP DB on a server, and it works fine.
Each night I do a full load of data, and it works fine for now. I know that somewhere down the line, I will...
I understand that to access a SQL database from Android I need to create a web service that will run on the SQL server and will process requests from the Android application, what I need to know is how to create this web service and how to access it from Android.
If anyone can point me in the right direction then this would be greatly ap...
I'm trying to add a query to my dataset and getting an error "Must declare the scalar variable @searchstr". I find this a little odd because I've used the @variable to pass parameters before no problem, but for whatever reason it fails here.
select DISTINCT g.groupname,
CASE WHEN s.siteguid = @searchstr THEN 1 ELSE 0 END AS doesitexis...
I have data like this. Following is the sample data.
I want to get all those CustomerIDs which has date diff of 2 hours in DateCreated of Enquiry.
For example CustomerId 10602 has 3 enquiries . If the time difference is 2 hours in any of these three enquiries then this CustomerId should be in my result set. Same for the other Custome...
I have about 45 XML data files and I need to create XSDs for them.
I have Visual Studio 2008 installed. What I am doing right now is opening up each XML file and creating the XSD from the menu option and then saving the XSD.
Is there a command line option for me to create all XSDs?
If not, is there a bulk XSD generation tool that can ...
Hello,
I'm having trouble figuring out the SQL statement to retrieve a specific set of data. Where all columns are equal except the last update date, I want the most recent. For example.
Book Author Update
John Foo 1/21/2010
John Foo 1/22/2010
Fred Foo2 1/21/2010
Fred Foo2 1/22/2010
What's the quer...
Silly question for the masses: Assume you have a table that handles the state of your object as it passes through your workflow.
Now assume you have a standard United States State table...
What do you call your US State table, without being redundant?
Additional Constraint - You can't pluralize your tables.
Some thoughts:
UnitedStat...