440 Posted Topics

Member Avatar for surk23

Hi >>> Or do i leave the 4 existing items where they were and put the two new items in elements [0] and [1] ? Yes, for it is a circular buffer, and as Momerath already stated "store the new value at the 'next' pointer and [COLOR="Green"]increment it modulus the …

Member Avatar for tesuji
0
180
Member Avatar for uwmbjn

Hi your task can easily be solved by means of a sub-select, in principle: [CODE]select * from yourtable where sequence in (select max(sequence) from yourtable group by ...) order by ...;[/CODE] Now your personal task is to figure out how group-by and order-by clauses must look like to meet your …

Member Avatar for tesuji
0
101
Member Avatar for sami.asanga

You need something like that: [CODE]update products set quantity = quantity - quvalue_from_admin_list where id_quantity = idvalue_from_admin_list [/CODE] Obviously, in PHP code from your other posting you also need to replace INSERT by above UPDATE ... -- tesu

Member Avatar for sami.asanga
0
97
Member Avatar for cpu278

Hi I am really confused, how is your "set of values (1,4)" related to your example table? An why you decide that then you should get the names 1 and 2? The names 1 and 2 point to what of your example table? I understand that your table is kind …

Member Avatar for cpu278
0
204
Member Avatar for sami.asanga

Maybe you replace INSERT by something like this: [CODE]update products set quantity = quantity - quvalue_from_admin_list where id_quantity = idvalue_from_admin_list [/CODE] This would somewhat coincide with your other posting. I have assumed that your admin's list is a sales list, therefore quantities on stock must be reduced by sold amounts. …

Member Avatar for sami.asanga
0
111
Member Avatar for Xufyan

Hello The cos-function y = cos(x) gives a value y which is from [-1 ... +1]. Its parameter x must be radians, that is for example -2*pi ... +2*pi, also values > 2*pi are allowed. Therefore the parameter y of the restricted inverse function x = acos(y) must always be …

Member Avatar for tesuji
0
697
Member Avatar for axas

Hello There is something more to do. Hint: First add a column to your table which simply indicates present and absent booking timestamps. Below is an example of a table with computed column [I][COLOR="Green"]isPresent [/COLOR][/I] and ordered by [I]PersonalNumber [/I] what I had already published elsewhere: [CODE]/* PersonalNumber BookingStamp isPresent …

Member Avatar for tesuji
0
140
Member Avatar for ssipiora

Hello I would do that with a user defined function or with any other .net programming language or even Java. Do you know Transact SQL, the SQL Server´s programming language which is very similar to standardized PSM language? Below user defined function, written transact-like, should insert @nbofRows in column lotnumber …

Member Avatar for tesuji
0
113
Member Avatar for new_tonio

This algorithm is linear in time. On a 100000 x 100000 chess board it lasts about one second for medium-fast computer. Possibly your program is running in endless loop. -- tesu

Member Avatar for tesuji
0
55
Member Avatar for munna_001

hello you may try this:[CODE]select userid, personid, positionid, count(positionid) as cntpos from yourtable group by userid, personid, positionid having cntpos > 1;[/CODE] btw, your table isn't that well normalized. -- tesu

Member Avatar for jbisono
0
124
Member Avatar for MoZo1

Hello Derby/JavaDB & JDBC/type2/3 is a perfect basis, I also use it in netbeans-developement. If you put all attributes together in just one relation/table, you will run into problems like insert/update/delete anomalies. Then you will be forced to patch by Java code for SQL queries will not work or too …

Member Avatar for MoZo1
0
112
Member Avatar for <maaniash>

Only starting hint, google this: generalization specialization relational modeling Now it's your turn. You may post in what you will then have decided, and we will discussing and possibly also improving your results. -- tesu

Member Avatar for tesuji
0
84
Member Avatar for red_ruewei

Glad to meet you again. Are you still suffering from the old database problem we were talken about in [URL="http://www.daniweb.com/forums/thread294619.html"]this[/URL] thread? What about the ERM fragment I sent you in the very last post of that thread, wasn't there any chance to improve data model? As for your first select, …

Member Avatar for red_ruewei
0
9K
Member Avatar for darkangel07

I would make use of [URL="http://en.wikipedia.org/wiki/Cramer%27s_rule"]Cramer's[/URL] rule and the rule of [URL="http://en.wikipedia.org/wiki/Rule_of_Sarrus"]Sarrus[/URL] which are easy to use for linear equations in three variables. -- tesu

Member Avatar for tesuji
0
151
Member Avatar for Venom Rush

Well, if I understand you correctly, then you want to select all product types together with the product types associate with a relevant team within a single query. This can be done by set operations union and difference or by subselects. I'll explain it step by step. First, let me …

Member Avatar for tesuji
0
226
Member Avatar for jeffsbaker

Let me try to explain what happen when your query executes: To filter out all rows having '4' key [I]question_id[/I] is used. 547 rows are affected. Next step is sorting the result set in descending order on column [I]score[/I]. Obviously there is no Index/key on this column which could support …

Member Avatar for tesuji
0
1K
Member Avatar for vicG

Hello Well, you could get better help if you were more precise on which tables exist and, important too, how they are related to. As rch1231 already did I also see some of these objects: 1st usertable pk(ipaddress, userid) ? 2nd useractivitytable fk(ipaddresse, userid), what pk ? 3rd activitytable pk(activityid) …

Member Avatar for vicG
0
143
Member Avatar for lsoon3

Hi These tables can hardly be joined together for the 2nd query does not contain table [I]v_Add_Remove_Programs[/I] of 1st query. Possibly the program what auto-generated the second query could know how [I]v_Add_Remove_Programs[/I] is related to the tables [I]v_GS_LOGICAL_DISK[/I], [I]v_FullCollectionMembership[/I],[I] v_R_System[/I] etc. of 2nd query. One also need to know where …

Member Avatar for tesuji
0
215
Member Avatar for james ang

[QUOTE=james ang;1301711]So let’s say i have a table with one column containing the following 6 records: [SR No#]='111' [Club Name], [Problem / Symptom Description], [SR No#]='111' [Club Name], [Problem / Symptom Description], [SR No#]='222' [Club Name], [Problem / Symptom Description], [SR No#]='222' [Club Name], [Problem / Symptom Description], [SR No#]='333' …

Member Avatar for tesuji
0
244
Member Avatar for jwebb

Well, and the body of function factorial(...) should be better completely replaced by [CODE]{ if(input<=1) return 1; else return input*factorial(input-1); } [/CODE]

Member Avatar for jwebb
0
676
Member Avatar for johnnyturbo3

Hello, there is a wrong primary key reference in your code, examine red-coloured lines: [CODE]USE streamlibrary; DROP TABLE IF EXISTS streamlibrary.FileProperties ; CREATE TABLE IF NOT EXISTS streamlibrary.FileProperties( [COLOR="Red"]PK_fileName VARCHAR(50) NOT NULL,[/COLOR] extension VARCHAR(4) NOT NULL , sizeMB DECIMAL(3) NOT NULL , location VARCHAR(50) NOT NULL , data VARCHAR(45) NOT …

Member Avatar for phpstan
0
217
Member Avatar for swornavidhya_m

Well, you are working on MS SQL Server. The error message: [COLOR="Red"]Violation of PRIMARY KEY CONSTRAINT 'PK_text_data'. Cannot INSERT duplicate key IN object 'text_data'.[/COLOR] means that the new row you are trying to insert in table [I]text_data[/I] already exists. That happens if one inserts same data twice. You can examine …

Member Avatar for tesuji
0
161
Member Avatar for supersoup

Hello, If I understand you correctly, there is a many-to-many relationship between METER and TC where the linking table is HISTORY (has got pk serial and tc from METER and TC). Primary key of HISTORY consists of (serial, tc, week, create_date). Then the select could be: [CODE]select h.`week`, h.create_date, ... …

Member Avatar for tesuji
0
167
Member Avatar for mijok

There are many people looking for normalized hotel systems. Even Richad Nixon once did so in China by the time Edgar Frank Codd borrowed the normalization theory from him. So can you be more specific? What have you got so far?

Member Avatar for tesuji
0
46
Member Avatar for stevthym

Kalimera, ti kanis (supposing you are living in the south part) UML-CS Actors could also be entities on ERM (and tables on RM later) depending on their relevance and scope of their data. Usually they are attributes of an entity named ACTOR, if necessary. If you had disclose some more …

Member Avatar for tesuji
0
2K
Member Avatar for shainjetly

Hello Yes, company is not an entity. Your explanation is correct. If your application is to manage many such parcel-service companies, it were a multi-client software (like SAP R/3). There are further entities I have found at a first glance: - Delivery_options and conditions - Serice_stations, especially where packages are …

Member Avatar for tesuji
0
479
Member Avatar for taylby

Hi Supposing your both queries select staffids which are not on holidays OR in sessions you should select staffids which are in both result sets: [CODE]select * from staff where staffid in (your select not on holidays ) AND staffid in (your select not in sessions);[/CODE] -- tesu

Member Avatar for taylby
0
269
Member Avatar for drats

Hello first, put your code between code tags and improve formatting: [CODE]select dp.product_lob As lobs, SUM(fs.written_premium_amt_ytd) As Gross_written_premium [B]from[/B] [COLOR="Green"]--xxx--[/COLOR] opening parenthesis (select dp.product_lob As lobs, SUM(fs.written_premium_amt_ytd) As Gross_written_premium FROM dbo.Fct_Summary as fs inner join Dim_product as dp on ( fs.product_key = dp.product_key ) inner join Dim_Calendar as dc on …

Member Avatar for tesuji
0
108
Member Avatar for PaulNelson

Both updates require different where-clauses. Therefore you can't do these updates within one update-statement. May I ask you why you would like to execute both updates within one statement? -- tesu

Member Avatar for PaulNelson
0
180
Member Avatar for muppet

Hi muppet Glad to meeting you again. How is Hayley Westenra doing? I didn't heard of any new song from her for some time past. I myself prefer her older po kare kare ana, also her interpretation of Kate Bush's Wuthering Heights is masterly performance. Of course, there is a …

Member Avatar for tesuji
0
157
Member Avatar for andydeans

Hi andyjeans, glad to meet you again. [CODE]... SELECT Product2ID, 'Product2', [COLOR="Red"]c.ClientID[/COLOR], c.App1FirstName, c.App1LastName, c.App1Email,c.App1Phone, c.App2Email, c.App2Phone, p.clients_ClientID FROM clients c JOIN Product2 p on c.ClientID = p.clients_ClientID WHERE p.clients_ClientID IS NULL [COLOR="Red"]GROUP BY ClientID[/COLOR] ... [/CODE] This is again wrong. All database systems but one stringently refuse execution of …

Member Avatar for tesuji
0
97
Member Avatar for jeeter19

Hi You already have got this: [CODE]select name, country_code from city where population >= 5000000);[/CODE] If you omit "name", you get a country_code list with all countries having at least one city with pop. >= 5000000. [CODE]select distinct country_code from city where population >= 5000000);[/CODE] This list can be used …

Member Avatar for jeeter19
0
97
Member Avatar for deven_a76

Hi what did you already do, are there any sql statements approaching the problem by yourself, tentatively in nature? -- tesu

Member Avatar for deven_a76
0
106
Member Avatar for Garrett2011

hi, decimal 12345 is hex [COLOR="Green"]0x00003039[/COLOR]. So to get a more practical example I changed: [CODE]character=*((char *)(&adad)+2); // 0x00 is stored[/CODE] to: [CODE]character=*((char *)(&adad)+1); // 0x30 is stored[/CODE] Assuming Intel processor, the assembly should look like: [CODE]lea ebx, adad ; address points to 0x39 (little Endian) add ebx, 1 ; …

Member Avatar for r.evrard
0
213
Member Avatar for muppet

These union selects [CODE]select reason_right as "Reason", sum(scrap_right) as "Quantity" from bakma_table where "Reason" IS NOT NULL group by "Reason" union select reason_left as "Reason", sum(scrap_left) as "Quantity" from bakma_table where "Reason" IS NOT NULL group by "Reason" order by "Quantity" desc ;[/CODE] should give such a list [CODE]| Reason …

Member Avatar for tesuji
0
149
Member Avatar for mimran2k

Hehe what school you attend selecting from age range 30 to 35? After all you are still programming for hidden dating site, isn't it? Why not writing a simple query as for example: [CODE]select all_my_dating from mytables where YEAR(CURDATE()-DOB) between 30 and 35; [/CODE] Hint: Never store age of a …

Member Avatar for drjohn
0
156
Member Avatar for Tommy.b

[CODE]Instead of: ... DB_INTERVAL_START < '11.78' AND DB_INTERVAL_END[COLOR="Red"] >=[/COLOR] '11.78' should it not be: ... DB_INTERVAL_START < '11.78' AND DB_INTERVAL_END [COLOR="Green"]<=[/COLOR] '1[COLOR="Green"]2[/COLOR].78' ? Sorry, wrong too or better: ... '1[COLOR="Green"]0[/COLOR].78' < DB_INTERVAL_START AND DB_INTERVAL_END [COLOR="Green"]<=[/COLOR] '1[COLOR="Green"]2[/COLOR].78' -- to get 5th line this works [/CODE] -- tesu

Member Avatar for Tommy.b
0
141
Member Avatar for cristi08

If your given example means that table 1 has 3 rows where 1st row ID is 1, 2nd row id is 2 etc and table 2 has 8 rows (!) then you can apply simple inner join to get the result: [CODE]select some_rows_from_table1, some_from_table_2 from table1 a join table2 b …

Member Avatar for cristi08
0
124
Member Avatar for weegie18

Hi who is OWNER of table user in: "select * from User" ? If dbo, then "select * from dbo.User" Aha, and not forgetting: "User" is a reserved keyword in SQL server which is not allowed to get redefined by you. Btw, there isn't any system table "User" which contains …

Member Avatar for tesuji
0
139
Member Avatar for rax_19

Hi simply divide clock-result by clocks per second, and don't forget the cast: [CODE]double_difference=double((end-start)) / CLOCKS_PER_SEC;[/CODE] to get the correct seconds. -- tesu

Member Avatar for rax_19
0
298
Member Avatar for el_vala

Hi don't worry, rows in database tables never have a particular order. This is a general rule for relational databases are based on set theory (at least as regard that). So if you want to get a certain order, you must make explicitly use of order function by [B]ORDER BY[/B] …

Member Avatar for el_vala
0
213
Member Avatar for visweswaran28

Hello I am not sure whether even and odd series of row numbers could help: [CODE]select -1+2*row_number() over (order by ID1 ASC) as rownumber, 'First Set' as whichSet, colA as "Data" from rowTest union select 2*row_number() over (order by ID2 DESC) as rownumber, 'Second Set' as whichSet, colB as "Data" …

Member Avatar for tesuji
0
160
Member Avatar for teedoff

Hi I am sure, you know that the precision and scale should be explicitely specified. If not, precision and scale of numeric and decimal DT are 10 and 0, that is default is decimal(10,0) or numeric(10,0). So numbers having decimal places will be automatically rounded. If you have money values, …

Member Avatar for teedoff
0
137
Member Avatar for Lomko

C99 standard defines some erf() in math.h (not cmath). Unfortunately, MS C++ math.h doesn't have erf(). Maybe my little erf() once I posted [URL="http://www.daniweb.com/forums/thread294232.html"]here[/URL] can also help you. Sure, boost is the best. -- tesu

Member Avatar for Lomko
0
706
Member Avatar for abbyadnez

Nice ERM :) Invoice against purchase of your customer is related to order. Your relationship –generates< is one-to-many which means that a certain order may have various invoices what is a good idea if your company is dealing with partial shipment. Here invoices usually have their own primary keys which …

Member Avatar for tesuji
0
82
Member Avatar for shock8

Hi Glad to meet a netbeans fan too. These problems leap to my eye: [CODE]PreparedStatement ps = conn.prepareStatement("INSERT INTO info VALUES (?,?,?,?,?)"); ps.setString(2, userInputname); ps.setString(3, userInputNIRC); ps.setString(4, userInputcontact); ps.setString(5, userInputemail); ps.setString(6, userInputl1r4); ps.execute(); -- The first ? is numbered 1, so the setters should be called with: ps.setString([B]1[/B], userInputname); ps.setString([B]2[/B], …

Member Avatar for shock8
0
188
Member Avatar for mutawari

Selamat siang, You are showing two tables jawab and kunci. Your select contains further tables: siswa in from clause and tabel_mk in where clause where the latter is missing in from clause. There is a further table tabel_jwb mentioned in your last question but one. So which tables are correct? …

Member Avatar for mutawari
0
151
Member Avatar for verbob

Hi I think it's a good idea to state a convenient example in the form of a data table and you may define "ranking" more precisely. (There are nice ranking functions in OLAP which has been offered by almost all databases since the ANSI SQL1999 standard.) -- tesu

Member Avatar for verbob
0
154
Member Avatar for chwong

hi >>> A distribute places an order is this a customer? >>> distributor will be ranking based on their sales are order and sales identical? >>> An order can consist of many product... ERM looks like: distribute? ----< order ----< order_details/item >---- product (---< is crowfoot) where order_details is many-to-many …

Member Avatar for chwong
0
785
Member Avatar for pritz01

Hi This problem cannot be solved with one single sql select statement. You need some procedural code, e.g. programmed in PSM, C, Java or PHP. I would design a user defined function or stored procedure in PSM to carry out this task. The procedure may function that way: Given a …

Member Avatar for tesuji
0
863

The End.