For example: where strword match with {%{J{GC * GC}J} or strword={%{J{GC * GC}J}
How to insert an existing GUID into Oracle RAW(16) field in a script
I have an sql server script which inserts known fixed guid values into a table. It looks like: Note that guid is in human-readable form. Since ID is uniqueidentifier sql server understands how to convert a string to guid data type. I need to make the same script for Oracle, ID is of RAW(16) type. Taking the s…
SQL – Blank default namespaces
I have a relation which has an XML column storing data in the following structure 04-12-2012 &…
Database Design – Loaner System – Customer loaning multiple items
I am implementing a loaner system and would like find out the most efficient / database standard structure technique to use for the loan records. Let me start with the basics: I have two tables: Customer_Record(id, f_name, l_name, p_number) Loaner_Pool(id, model, serial_n, status) The idea is that the loaner …
How do I update multiple columns with a subquery in a single statement?
I am attempting to update a temp table from a source table: Unfortunately it complains Answer After much trial and error I pooled some help at work and we came up with this: Which sybase seems to accept.
MySQL Group By Hours
I’m trying to get a report from my history table by hourly usage. history table is; CREATE TABLE IF NOT EXISTS `history` ( `history_id` int(11) unsigned NOT NULL AUTO_INCREMENT, `user_id` int(11) …
Optimize a SQL query : call a function or do a join?
What is the fastest in an ORACLE database ? Call a function inside a select statement to retrive a single value for each row SELECT field1, field2, F_GET_LIBELLE_STATUT( field2 ) FROM table1 WHERE …..
How to rewrite IS DISTINCT FROM and IS NOT DISTINCT FROM in SQL Server 20008R2?
How do you rewrite expressions containing the standard IS DISTINCT FROM and IS NOT DISTINCT FROM operators in the SQL implementation in Microsoft SQL Server 2008R2 that does not support them? Answer The IS DISTINCT FROM predicate was introduced as feature T151 of SQL:1999, and its readable negation, IS NOT DI…
How to change only the year of a date datatype
I have a list of birthdays and the year is the only part that is incorrect. I have a list of ID #s for these individuals. Is there a way to change only the year for all of these people? I was thinking something like making a table of the query results and then using an UPDATE SET query, but
Using group by on two fields and count in SQL
I have a table in my mysql db that has two columns: group and subgroup. See below. group, subGroup grp-A, sub-A grp-A, sub-A grp-A, sub-B grp-B, sub-A grp-B, sub-B grp-B, sub-B I am …