Yes, create a before insert trigger for the table and use it to populate the key number column.
create trigger setKeyNumber for mytable
active before insert 10
as
begin
new.keyNumberColumn = <<sql used to generate the keyNumber value>>
end
^
ujb
From what I can see this is because
"SELECT MAX(ExamDate) FROM MathHistory"
gives you the max exam date for mathhistory rather than just the max exam date for max history where maxhistory.classid = StudentRecord.classid, therefore you will need to include the same selection criteria for the...
Try
SELECT * INTO dbo.shopping_TSR FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=c:\inetpub\wwwroot\fileuploader\upload\tmb2.xls', 'SELECT * FROM [Sheet1$]')
If I read this right your report parameter is multi-valued and you want to carry out some processing to ensure that when you check a particular list value (in this case 'All'), this action then causes all the other values in the list to also be checked. If this is so then I'm not sure if what...
Thanks, this also relates to a question I posed back in May about why I should be using dateadd when I don't need
to return the time component. I will add your observations to my grab-bag of cool tricks - and this therefore deserves a purple thingy. :-)
Dunno about it being the best way but here is one way.
DELETE FROM [table-a]
FROM [table-a] ta LEFT JOIN [table-b] tb ON
ta.site_no = tb.site_no WHERE tb.site_no IS NULL
Not familiar with PHP over FireBird but I'll have a stab, the SQL syntax shouldn't really affect what you are doing, as long as you are doing something like this:
select my_blob from my_table where my_table_pk = x
Then as long as you have defined the BLOB sub type as text you should be able to...
Parameter sniffing - don't know if this is of any particular help but I was caught by the parameter sniffing issue a few weeks ago; I had managed to solve it, I just didn't know why it was happening
:-)
Anyway for what its worth I wound up setting a local variable to the value of the parameter...
No, what your suggestion will give me is this:
Male Female Total
Single Married Single Married
USA 10 5 2 20 37
UK 20 6 3 30 59
If I add a subtotal to sex, I get precisely that - a sub...
Hi all, I have a minor issue with a matrix report.
I would like the output to look like this...I have made up the column names for the purposes of illustrating the point.
Male Female Total
Single Married Single Married Single Married
USA 10 5 2 20 12...
What about something like this...
select customer.*,ISNULL(max(a.the_date),setup_date) from
customer
left join (
select custid, max(order_date) as the_date from orders
group by custid
union
select custid, max(invoice_date) as the_date from invoice
group by custid
union
select custid...
You can get back that credit by mentioning that WITH RECOMPILE is only one option, another would be to use something like...
OPTION (HASH JOIN)
...to force a particular join approach within the SQL statement(s) - if that is where the original problem lies :-)
I'm in the neighbourhood so thought I'd add a note to this post. One reason why some queries run slowly without any visible clue is that sometimes InterBase's query 'optimizer' does not pick the most appropriate plan when dealing with large result sets. In particular if you have a small table...
Thanks guys, clear as day now I look at it again. When used in the context of an implicit data type conversion - as I have been doing - the two statements return the same result.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.