Can anybody tell me how to select data from two tables, without having to use join? Something like this: SELECT t1.*, t2.* FROM table1 t1, table2 t2 ###Clarification I have these …
Search between two SQL tables?
I have two tables: student Columns first_name last_name teacher_accounts Columns fname lname I have an input form that takes the data entered into an input field, and passes it through the …
How to populate a table’s foreign keys from other tables
I’ve got the following tables, of which translation is empty and I’m trying to fill: The source data to fill translation is a temporary table that I’ve populated from an external CSV file: What I’d like to do is to fill translation with the values from tmp_table. The translated field c…
MySQL – CREATE FUNCTION ? MODIFIES SQL DATA?
I am about to write a CREATE FUNCTION with MySQL and I am wondering, if CREATE TEMPORARY TABLE counts toward flag MODIFIES SQL DATA. Function does not modify any permanent table, just temporary table, …
Selecting most recent and specific version in each group of records, for multiple groups
The problem: I have a table that records data rows in foo. Each time the row is updated, a new row is inserted along with a revision number. The table looks like: id rev field 1 1 test1 2 1 …
Issues using sqlsrv_rows_affected, it keeps returning false even when its true
I have a query that changes a users password, and I want to check the users knows their current password before being able to change it. So it is working, I need to enter the current password before changes will be made, but my outputs are still always false, here is the code I have: Can anyone see this won&#…
SQL – Subtracting a depleting value from rows
I have a situation where I need to take a “quantity consumed” from one table, and apply it against a second table that has 1 or more rows that are “pooled lots” of quantities. I’m not sure how to describe it better, here’s what I mean from a table perspective: I need a resu…
How to update with inner join in Oracle
Could someone please verify whether inner join is valid with UPDATE statment in PL SQL? e.g. Update table t set t.value=’value’ from tableb b inner join on t.id=b.id inner join tablec c on c.id=b.id …
Creating index if index doesn’t exist
I have a problem creating an index with the advantage database server if it doesn’t exist with a sql query. My query looks like this: So I don’t use FullTextSearchIndizes,because it is a integer field. Otherwhise it would look like this: So, my only problem is how do I get the indices. I’ve …
I need to find and replace n in a mysql field
i’ve got data like this: 1 streetn2streetnmycitynmytown What i want to do is replace n with char(10) as i need a real linebreak in the db field. I’ve got: UPDATE data set `value` = REPLACE(`…