I have a MySQL DB in which I store data about each user.
I would like to add a list of friends for each user. Should I create a table of friends for each user in the DB or is there a better way?
Consider the following code:
SET @SQL1 = 'SELECT * INTO #temp WHERE ...'
exec(@SQL1)
SELECT * from #temp (this line throws an error that #temp doesn't exist)
Apparently this is because the exec command spins off a separate session and #temp is local to that session. I can use a global temporary table ##temp, but then I have to come up with a…
What is the upper limit of records for MySQL database table. I'm wondering about autoincrement field. What would happen if I add milions of records? How to handle this kind of situations?
Thx!
I get Run time error:Type mismatch for the following code:
Dim Field
Field="Gen8"
'''' ============================================================================== EXCEL Sheet
'==============Errors -Stacked Chart by Year and Week --ALL WEEKS
''''===================================================
…
I have a large list of phrases / quotes / sentences in a text file. Mixed alphanumeric text, it hasn't been screened for "'s or ''s.
Is there an easy way to throw this into a table?
Scenario
I have an TWO datbase tables of exactly the SAME STRUCTURE. The difference between these tables is that one contains data populated by one application and the other is populated by a different application. Each application is trying to produce the same result, but using two different methods of implementation.…
I need to add a period after the chapter/table/figure number in each line in Table of Contents/LoT/LoF.
ie, right now it shows:
TABLES
1 first
2 second
but I need it to show:
TABLES
1. first
2. second
I know this can be done with the tocloft package, however, that package is conflicting with the latex style…
Hit a speed bump, trying to update some column values in my table from another table.
This is what is supposed to happen when everything works
Correct all the city, state entries in tblWADonations by creating an update statement that moves the zip city from the joined city/state zip field to the tblWADonations…
Suppose I have one string list may have duplicated items:
A
B
C
A
A
C
D
E
F
F
I want to make a list can assign an unique index for each item, looks like:
1 A
2 B
3 C
4 D
5 E
6 F
now I created sqlite3 database with below SQL statement:
CREATE TABLE aa ( myid INTEGER PRIMARY KEY AUTOINCREMENT,
…
OMG! What am I doing wrong?
declare @WTF TABLE (
OrderItemId int
)
SELECT TOP 20 OrderItemId as OrderItemId INTO [@WTF] FROM ac_OrderItems
SELECT * FROM [@WTF]
Problem A: This creates a PHYSICAL table called @WTF. WHY?? I thought this was in memory only?!
Problem B: The last line of code, if I do select * from…
This may be a silly question, but it may shed some light on how joins work internally.
Let's say I have a large table L and a small table S (100K rows vs. 100 rows).
Would there be any difference in terms of speed between the following two options?:
OPTION 1: OPTION 2:
--------- …
Hi, few questions, just wondering if anyone can help?
I have a table with 1 long row (1000 pixels) and one single column, how do i go about creating a method whereby when the mouse cursor is on the leftmost side of the cell, a variable, lets say X is set to 0, the further right the mouse cursor moves in the…
I have 2 tables,
Stores - storeId (int) and year (int(4)) both Primary Keys.
fruit - fruitId - Primary Key and storeId.
I need to create 1 to many relationship between the Store and Fruit (Foreign Key held within Fruit) how ever I always get shown the error -
The Columns in table <table> do not…
So I have built a voting system for a custom post system i wrote.
I want to be able to sort by "most voted", "Most liked", etc.
I have two tables.
Entry: ID, Title, Post
Vote: ID, EntryID, Result
I want to be able to query the vote table for each entry and see how many vote's there are, and then sort…
Hello Guys!
I have 2 tables: User and Picture. The Picture table has the key of the user. So basically each user can have multiple pictures, and each picture belongs to one user.
Now, I am trying to make the following query: I want to select all the user info plus the total number of pictures that he has…
I have a DB with a table that is named "victim". The form that dumps the info into the table has room for two victims and therefore there is vic1_fname, vic1_lname, vic2_fname, vic2_lname, etc.. (business name, person first, person last, address, city, state, zip) a "1" and "2" of each. Now I want to…
I'm working for a university project, and I have the following question:
I have 2 tables in a Oracle DB... I need to select those rows from table1, which are not included in table2... But the main problem is that I need to exclude that rows from table2 wich was selected once... For example:
Table1 …
Is there any way to modify the CSS properties of one table's cells based on the table's ids, rather than specific child ids?
I would like to change one table's appearance (giving each cell a colored border, for instance) one way, and another table another way, but I'd like to avoid specifying an id…
In Excel 2007, if you highlight a block of cells and then "Format as Table", it doesn't just apply colors and formatting, it somehow marks those cells as being a table.
Now I want to get rid of the table, but keep all the cells (i.e. keep the data). So I tried clearing the table style and…
I have a simple class hierarchy, similar to the following:
@Entity
@Table(name="animal")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="animal_type", discriminatorType=DiscriminatorType.STRING)
public abstract class Animal { }
@Entity…
Hello. I can run RENAME TABLE student TO student_new
;
The command is same and easy to follow.
Is there a methods to rename a lot of tables in simple command. Assume all the tables belog to the same DB name.
I don't need write a lot of code as below?
RENAME TALBE…
Hi all,
I have a table called Users (class User < ActiveRecord::Base) and a subclass/STI of it for Clients (class Client < User).
Client "filtering" works as expected, in other words Client.find(:all) works to find all the clients.
However, for users I need…
If I have a list of objects
IEnumerable<MyType> myTypes;
Is it possible for me to return this to the client as JSON
return Json(myTypes);
and if so, is it possible for me to convert this (now JSON format) list to a when it gets to the client?
Is there…
CREATE OR REPLACE PROCEDURE p_create_dynamic_table IS
v_qry_str VARCHAR2 (100);
v_data_type VARCHAR2 (30);
BEGIN
SELECT data_type || '(' || data_length || ')' INTO v_data_type FROM all_tab_columns WHERE table_name = 'TEST1' AND column_name = 'ZIP';
FOR…
I am trying to alter column datatype of a primary key to tinyint from int.This column is a foreign key in other tables.So,I get the following error:
Msg 5074, Level 16, State 1, Line 1 The object 'PK_User_tbl' is
dependent on column 'appId'. Msg…